473,385 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

<TD> font size attribute?.

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
2 96813
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 vão. O resto é imperfeito.
- Renato Russo -
Jul 21 '05 #2
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mel | last post by:
is it possible ? i tried size=100% and 'NADA !' thanks, Mel
1
by: Stan Brown | last post by:
In looking over my style sheet http://www.acad.sunytccc.edu/instruct/sbrown/screen.css I see that I have identical fonts and colors set on table and td elements. Is there any reason to do this,...
3
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample...
3
by: Radek | last post by:
How can I get the following to appear on just 1 line? <style type="text/css"> #center { text-align: center;} #left { text-align: left;} #right {text-align: right} </style> <table border=1...
2
by: js | last post by:
I have a table rendered with XSLT. The first column has a radio button controls for user to make a selection for a particular row. All the values in the remaining columns are all concated with a...
2
by: Pete Kipe | last post by:
I'm not a JavaScript programmer...but I'm trying to put together a simple menu system for a new website and need a little help. I have the following script: <SCRIPT language=javascript> <!--...
5
by: mahesr | last post by:
I want to match some particular text between <tr>and </tr> or <td>and </td>.... in PHP. like below............ <table><tr> CATEGORY: <td><font face="Verdana" size="1" color="#A000A0"> Wedding...
5
by: Michael | last post by:
Hi. I need dinamically calculate input text field based on parent static TD before showing content of input. Please, advice. Michael
0
by: Peter Boritz | last post by:
I am new to Tidy and am using the .Net version. Tidy is picking up <span> tags nested inside of <td>. These are the result of Microsoft Clipboard GetData(HTML) which does a pretty sloppy job in a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.