Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Style of font for tables

Reply
Thread Tools

Style of font for tables

 
 
Stacey R. Brodsky
Guest
Posts: n/a
 
      12-23-2003
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


 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      12-23-2003
Stacey R. Brodsky wrote:

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


<code> says nothing about the way the text should look. It just says that
the text is "a fragment of computer 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.


In this context, that is the only place it is valid. <code> is an inline
element.

> 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.

--
David Dorward <http://dorward.me.uk/>
 
Reply With Quote
 
 
 
 
Andrew Glasgow
Guest
Posts: n/a
 
      12-25-2003
In article <1U_Fb.5320$>,
"Stacey R. Brodsky" <sbrodsky68@^nospam^aol.com> wrote:

> 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
browser applies the <code> text format to the entire contents of the
table, it is doing the Wrong Thing(tm).

> 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'.

--
| Andrew Glasgow <amg39(at)cornell.edu> |
| "A computer lets you make more mistakes faster than any invention in human |
| history, with the possible exceptions of handguns and tequila." |
| -- Mitch Ratcliffe, Technology Review, April 1992 |
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing Font, it's Java Font? ot native? how install new font? mttc Java 2 07-03-2009 07:29 PM
How to get the text in html tag.like<div...><font...>Text</font></ =?Utf-8?B?Tmlja3k=?= ASP .Net 2 02-20-2005 03:03 PM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
Font class, external font files question Karl Hungus ASP .Net 1 02-04-2004 04:26 PM
physical font specified but true type font file not available Michael Glavitsch Java 1 07-15-2003 07:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57