Style of font for tables

Discussion in 'HTML' started by Stacey R. Brodsky, Dec 23, 2003.

  1. 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
    Stacey R. Brodsky, Dec 23, 2003
    #1
    1. Advertising

  2. 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/>
    David Dorward, Dec 23, 2003
    #2
    1. Advertising

  3. 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 |
    Andrew Glasgow, Dec 25, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karl Hungus

    Font class, external font files question

    Karl Hungus, Feb 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    523
    Karl Hungus
    Feb 4, 2004
  2. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    705
    Matt Berther
    Feb 20, 2005
  3. Michael Glavitsch
    Replies:
    1
    Views:
    759
    Roedy Green
    Jul 15, 2003
  4. mttc
    Replies:
    2
    Views:
    2,382
    Roedy Green
    Jul 3, 2009
  5. Ken Varn
    Replies:
    0
    Views:
    439
    Ken Varn
    Apr 26, 2004
Loading...

Share This Page