Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: DHTML
Expertise: Beginner
Oct 20, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Set Font Size in Tables Using DHTML


In Microsoft Internet Explorer, I can specify a style as

TABLE.listTable { font-size : "10pt"}

and all the cells of the table will have a 10pt font size.

In Netscape, this approach doesn't work because the font sizes have to be specified for each cell (

), and any font specification you do at the table level doesn't apply to each cell. Can you suggest a solution so I don't have to specify something like

classes.listTable.td.fontSize = "10pt"

and add the CLASS=listTable to each



You can specify a setting for table cells (TD) elements using a style sheet:

  TD { color: red; font-size: larger }

However, you have to be careful of your use of other style and formatting with the table as this can override the TD setting. For instance, not closing a table element, or using nested elements can turn off the global style setting.

For example, define a global style setting using:

and then create a table like this:

Hello there

The table contents will show red, with a larger font size, for Netscape Navigator 4.x and up, and IE 4.x and up, in a Windows environment.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date