Style of font for tables

S

Stacey R. Brodsky

Hi all,

I have created a table, but I want all of the text int the table to be
<code></code>. I have tried it outside the table and inside...the only place
it works is if I surround the text in each <td></td> with the 'code' tag.

Is there a way to have the whole table print in 'code' without having to
repeat the tag over, and over again? Possibly a style sheet...although I
would have no idea how to do that.

Any suggestions welcome,
Stacey
 
D

David Dorward

Stacey said:
I have created a table, but I want all of the text int the table to be
<code></code>.

I have tried it outside the table and inside...the only
place it works is if I surround the text in each <td></td> with the 'code'
tag.

Is there a way to have the whole table print in 'code' without having to
repeat the tag over, and over again? Possibly a style sheet...although I
would have no idea how to do that.

It seems somewhat unlikely that you have computer code that is tabular data.
If it really is code, then you need to place the <code> tags in each cell
(and stop using a table if it is not real tabular data).

If it isn't really code, then you should stop using a tag becuase of the way
your browser happens to present that data to the user - use a style sheet
for presentation (in combination with tags which correctly structure the
text).

http://dorward.me.uk/www/css/#tutorials has links to basic style sheet
tutorials.
 
A

Andrew Glasgow

Stacey R. Brodsky said:
Hi all,

I have created a table, but I want all of the text int the table to be
<code></code>. I have tried it outside the table and inside...

<code> is an inline element so it cannot contain a block level element
like <table>. Technically an inline element like <code> automatically
terminates when a block-level element like <table> shows up. If a
the only place
it works is if I surround the text in each <td></td> with the 'code' tag.

Exactly the way it is supposed to be, if, that is, your table contains
blocks of computer code.
Is there a way to have the whole table print in 'code' without having to
repeat the tag over, and over again? Possibly a style sheet...although I
would have no idea how to do that.

A style sheet is exactly what you want to use. Go here:
<http://www.htmlhelp.com/reference/css/> or google for 'Cascading Style
Sheets tutorial'.
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top