By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,160 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,160 IT Pros & Developers. It's quick & easy.

<TD> font size attribute?.

P: n/a
Hi,
I want to use CSS to define the font size in every cell of a table. This
avoids needing to define the font size in every <TD> tag using the normal
multiple HTML <FONT SIZE="2"> notation. Therefore my question is, Is there a
CSS attribute I can set on the <TD> tag that will set the size of any text
within the table cell?.

Regards,
Dave

Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Els
Dave Moore wrote:
Hi,
I want to use CSS to define the font size in every cell of a table. This
avoids needing to define the font size in every <TD> tag using the normal
multiple HTML <FONT SIZE="2"> notation. Therefore my question is, Is there a
CSS attribute I can set on the <TD> tag that will set the size of any text
within the table cell?.


td{font-size:100%;}

If you want this to be applied only to certain table cells, you add
class="certain"
to each <td>, and
td.certain{font-size:100%;}
in the CSS.

If for instance you want all <td>s in certain rows to take the effect,
you add the class to the <tr> instead of to the <td>, and use this in
the CSS:
tr.certain td{font-size:100%;}
--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -
Jul 21 '05 #2

P: n/a
On Wed, 01 Jun 2005 12:55:45 +0200, Dave Moore
<da**********@baesystems.com> wrote:
Hi,
I want to use CSS to define the font size in every cell of a table.
This avoids needing to define the font size in every <TD> tag using the
normal
multiple HTML <FONT SIZE="2"> notation.
Excellent idea. Some people will respond that you shouldn't use different
font sizes at all, but that is a different subject.
Therefore my question is, Is there a CSS attribute I can set on the <TD>
tag that will set the size of any text within the table cell?.


No need for that. CSS selectors can refer directly to elements. Example:

td {font-size: small;}
If you want to limit styles to a certain table, you can add a class
attribute to the table:

<table class="tablename"><tr><td>example</td></tr></table>

and refer to that:

table.tablename td {font-size: small;}
Any basic CS guide will help you with this. For example:
http://www.htmlhelp.com/reference/css/

--
Get Opera 8 now! Speed, Security and Simplicity.
http://my.opera.com/Rijk/affiliate/

Rijk van Geijtenbeek

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.