Where to put the css class for text?

J

John Sutter

I have a list of orders in a html table. Each order is a link and it's
contained in a td. I would like to format the text displayed using css.
Where should I put the css class name? In the TD tag or in the font tag or
somewhere better?

For example:

..... <TD class="ordertext"><a href=...>Order #1</a> </td>
or
.... <TD><font class="ordertext"><a href=...>Order #1</a></font> </td>
or
??

John
 
M

Mark Parnell

I have a list of orders in a html table.

Sounds like it *could* be tabular data. ;-)
Each order is a link and it's
contained in a td. I would like to format the text displayed using css.

Glad to hear it.
Where should I put the css class name? In the TD tag or in the font tag or
somewhere better?

What font tag? You don't mean you are thinking of using <font>, which
was deprecated in favour of CSS, to apply CSS styles?

Anyway...
.... <TD class="ordertext"><a href=...>Order #1</a> </td>

If it applies to every link in the table, why not apply it to the table?
Then you only have to put it in once. :)
 
R

Richard

John Sutter wrote:

I have a list of orders in a html table. Each order is a link and it's
contained in a td. I would like to format the text displayed using css.
Where should I put the css class name? In the TD tag or in the font tag
or somewhere better?
For example:
.... <TD class="ordertext"><a href=...>Order #1</a> </td>
or
... <TD><font class="ordertext"><a href=...>Order #1</a></font> </td>
or
??

Depends on how you want to use it.
<table class="x"> would be for the entire table.
<tr class="x"> for the entire row.
<td class="x"> for the single cell.

Don't use the font tag. Instead, put that in your css stuff using the font:
attribute.
 
R

Richard

Sounds like it *could* be tabular data. ;-)

I'd still like to know who it is that defined tabular=tables.
Probably the same guy who designed css.
Why do people use tables for layout presentation?
Because it's simple and easy to do and accepted worldwide.
Show me a web editor that creates divisions in the same manner as tables.

I'll bet a peso you can't do it.
But every editor I've seen has a table generator.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top