Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatting the text in a table with CSS

Tags:

I need some basic css help. I attempted to style the cells of a table using a css stylesheet, but its not working

The code of the table is:

<table> 
<tr><td><p style="font-size:13px"><a href="mailto:[email protected]">XXX&nbsp;&nbsp;&nbsp;</a></p></td><td><p style="font-size:13px">XXXX&nbsp;&nbsp;&nbsp;</p></td><td><p style="font-size:13px">XXXXXXX   </p></td></tr> 
   <tr><td><p style="font-size:13px"><a href="mailto:[email protected]">XXX&nbsp;&nbsp;&nbsp;</a></p></td><td><p style="font-size:13px">XXXX&nbsp;&nbsp;&nbsp;</p></td><td><p style="font-size:13px">XXXXXXX   </p></td></tr> 
    <tr><td><p style="font-size:13px"><a href="mailto:[email protected]">XXX&nbsp;&nbsp;&nbsp;</a></p></td><td><p style="font-size:13px">XXXX&nbsp;&nbsp;&nbsp;</p></td><td><p style="font-size:13px">XXXXXXX   </p></td></tr> 
     <tr><td><p style="font-size:13px"><a href="mailto:[email protected]">XXX&nbsp;&nbsp;&nbsp;</a></p></td><td><p style="font-size:13px">XXXX&nbsp;&nbsp;&nbsp;</p></td><td><p style="font-size:13px">XXXXXXX   </p></td></tr> 
      <tr><td><p style="font-size:13px"><a href="mailto:[email protected]">XXX&nbsp;&nbsp;&nbsp;</a></p></td><td><p style="font-size:13px">XXXX&nbsp;&nbsp;&nbsp;</p></td><td><p style="font-size:13px">XXXXXXX   </p></td></tr> 
       <tr><td><p style="font-size:13px"><a href="mailto:[email protected]">XXX&nbsp;&nbsp;&nbsp;</a></p></td><td><p style="font-size:13px">XXXX&nbsp;&nbsp;&nbsp;</p></td><td><p style="font-size:13px">XXXXXXX   </p></td></tr> 
        <tr><td><p style="font-size:13px"><a href="mailto:[email protected]">XXX&nbsp;&nbsp;&nbsp;</a></p></td><td><p style="font-size:13px">XXXX&nbsp;&nbsp;&nbsp;</p></td><td><p style="font-size:13px">XXXXXXX   </p></td></tr> 
         <tr><td><p style="font-size:13px"><a href="mailto:[email protected]">XXX&nbsp;&nbsp;&nbsp;</a></p></td><td><p style="font-size:13px">XXXX&nbsp;&nbsp;&nbsp;</p></td><td><p style="font-size:13px">XXXXXXX   </p></td></tr> 
                  </table>

The only way I got the text to not go to browser defaults was to explicitly state it on every single cell, which seems like a waste of load time (as miniscule as it is). Is there a way to set the size of the text for the entire table? It's is all the same size.

I tried putting the table inside a <p> and then styling it using a CSS class, but it was not working. Not sure if it matters, but I am using XHTML 1.0.