thank you sam - the table man

Discussion in 'HTML' started by WindAndWaves, Aug 7, 2004.

  1. WindAndWaves

    WindAndWaves Guest

    Hi gurus

    I often work with tables and I found that I am confused on where I should be
    placing the following elements:

    width
    height
    valign

    could I put all of them in the TD tag and leave the TABLE and TR tag blank?

    Thank you

    Nicolaas
    WindAndWaves, Aug 7, 2004
    #1
    1. Advertising

  2. WindAndWaves

    Webcastmaker Guest

    In article <kKXQc.10001$>,
    says...
    > I often work with tables and I found that I am confused on where I should be
    > placing the following elements:
    > width
    > height
    > valign
    > could I put all of them in the TD tag and leave the TABLE and TR tag blank?


    Well ignoring the naming issues, the answer is none of the above.
    Use CSS
    --
    WebcastMaker
    The easiest and most affordable way to create
    Web casts, or put presentations on the Web.
    www.webentations.com
    Webcastmaker, Aug 7, 2004
    #2
    1. Advertising

  3. WindAndWaves

    WindAndWaves Guest

    Dear WebcastMaker

    There are two reasons that I put it in the html:

    1. browsers that do not support css can still read it and make sense of
    things (or in case for some reason the css does not load properly).

    2. it is easier to edit the pages if you know in the html how big the cells
    are and the like, it is this ease of editing that I use more than anything
    (my sites are completely database driven - but someone still has to write
    the templates).

    Thank you. still keen to find out the answer.
    WindAndWaves, Aug 7, 2004
    #3
  4. "WindAndWaves" <> wrote:

    > width
    > height
    > valign


    Height does not belong in tables. Check out the specs and validate your
    designs ... :)

    The Doormouse

    --
    The Doormouse cannot be reached by e-mail without her permission.
    The Doormouse, Aug 7, 2004
    #4
  5. WindAndWaves

    WindAndWaves Guest

    so how do you specify a table to have a certain height????

    can you use <TD HEIGHT=20>? or <TR HEIGHT=20>???
    WindAndWaves, Aug 7, 2004
    #5
  6. "WindAndWaves" <> wrote:

    > so how do you specify a table to have a certain height????
    >
    > can you use <TD HEIGHT=20>? or <TR HEIGHT=20>???


    No, you don't specify it. At best, you could put a spacer GIF in there
    somewhere. Or, use CSS to specify it.

    The Doormouse

    --
    The Doormouse cannot be reached by e-mail without her permission.
    The Doormouse, Aug 7, 2004
    #6
  7. WindAndWaves

    WindAndWaves Guest

    Sorry to bother Doormouse, but why don't you specify it, is there any
    specific reason for that?
    WindAndWaves, Aug 7, 2004
    #7
  8. WindAndWaves

    rf Guest

    [crosspost removed, not on my server]

    WindAndWaves wrote

    Please quote a little of the post to which you are replying. It makes it far
    easier to follow the conversation.

    > Sorry to bother Doormouse, but why don't you specify it, is there any
    > specific reason for that?


    Width and Height for table cells has been deprecated in favour of CSS. Width
    and height is a presentational issue and presentational issues should be
    handled with CSS.

    Since these attributes have been deprecated they are not supported by the
    strict DTD so your page will not validate to strict if you use them.

    http://www.w3.org/TR/html4/struct/tables.html#adef-height-TH
    http://www.w3.org/TR/html4/struct/tables.html#adef-width-TH
    and
    http://www.w3.org/TR/REC-CSS2/tables.html

    --
    Cheers
    Richard.
    rf, Aug 7, 2004
    #8
  9. WindAndWaves

    Hywel Guest

    Hywel, Aug 7, 2004
    #9
  10. WindAndWaves

    Webcastmaker Guest

    In article <kYXQc.10008$>,
    says...
    > There are two reasons that I put it in the html:

    Both reasons are invalid.

    > Thank you. still keen to find out the answer.

    You have your answer. Notice how everyone gave your the same answer?
    Use CSS. You just don't like the answer.

    --
    WebcastMaker
    The easiest and most affordable way to create
    Web casts, or put presentations on the Web.
    www.webentations.com
    Webcastmaker, Aug 7, 2004
    #10
  11. WindAndWaves

    WindAndWaves Guest

    Dear webcastmaker,

    I hope you are enjoying your day. I am actually changing my site. Thank
    you for your answer.
    WindAndWaves, Aug 7, 2004
    #11
  12. WindAndWaves wrote:
    > I often work with tables and I found that I am confused on where I should be
    > placing the following elements:
    >
    > width
    > height
    > valign


    Those are attributes, not elements. More importantly, though, you don't
    want to be using those particular attribures. They deal with
    presentation, something which HTML was never meant to do.

    On a guess, you're using a table to lay out your page. If so, read
    <http://www.allmyfaqs.com/faq.pl?Tableless_layouts>.
    Leif K-Brooks, Aug 7, 2004
    #12
  13. WindAndWaves

    Webcastmaker Guest

    In article <>,
    says...
    > > I often work with tables and I found that I am confused on where I should be
    > > placing the following elements:

    > Those are attributes, not elements. More importantly, though, you don't
    > want to be using those particular attribures. They deal with
    > presentation, something which HTML was never meant to do.
    > On a guess, you're using a table to lay out your page. If so, read
    > <http://www.allmyfaqs.com/faq.pl?Tableless_layouts>.


    Your just blowing smoke here. This guy has no intentions of
    listening to anyone until they say "why yes, put those "elements"
    here....
    --
    WebcastMaker
    The easiest and most affordable way to create
    Web casts, or put presentations on the Web.
    www.webentations.com
    Webcastmaker, Aug 7, 2004
    #13
  14. "WindAndWaves" <> wrote:

    > Sorry to bother Doormouse, but why don't you specify it, is there any
    > specific reason for that?


    Height is controlled by content (or by CSS). Content is always paramount.
    Also, the height tag has never been valid HTML, AFAIK. The width tag,
    however, I do use from time to time and will validate as HTML 4.01
    Transitional.

    If you absolutely must have a certain height, you can use a spacer or
    CSS. A spacer will always work - regardless of whether your CSS works or
    not. CSS gives better control and can hold comments, too.

    Spacer GIF:
    * make transparent in several convenient sizes (5, 10, 25 pixels for
    example).
    * can be any width/height that you want.
    * many of the same benefits as CSS, plus ultimately very backwards-
    compatible

    CSS:
    * much greater control possible
    * comments possible, easy maintenance
    * one-stop shopping for presentational control

    The Doormouse

    --
    The Doormouse cannot be reached by e-mail without her permission.
    The Doormouse, Aug 7, 2004
    #14
  15. Webcastmaker <> wrote:

    > You have your answer. Notice how everyone gave your the same answer?
    > Use CSS. You just don't like the answer.


    A spacer works too. :)

    The Doormouse

    --
    The Doormouse cannot be reached by e-mail without her permission.
    The Doormouse, Aug 7, 2004
    #15
  16. WindAndWaves

    Andy Dingley Guest

    On Sat, 7 Aug 2004 15:05:24 +1200, "WindAndWaves" <>
    wrote:

    >I often work with tables and I found that I am confused on where I should be
    >placing the following elements:
    >
    >width
    >height
    >valign
    >
    >could I put all of them in the TD tag and leave the TABLE and TR tag blank?


    It's time you learned to read a DTD
    http://www.w3.org/TR/html4/sgml/dtd.html

    or the version with notes
    http://www.w3.org/TR/html4/struct/tables.html#edef-TABLE

    The great thing about HTML (and pretty much all net protocols) is that
    _you_ can read the real protocol definitions for yourself and for
    free. Don't get it second-hand from some hack journalist's book, read
    the genuine article.


    Reading these, you'll find that only the <td> has width and height.,
    and <tr> doesn't. <table> also has width, but that's the width of the
    whole table, not a cell.

    The align (horizontal) and valign attributes apply to both <tr> and
    <td>, with scope applied much as you might expect.

    There's also the <colgroup> and <col> elements, which are much
    under-used. I've seen people nest tables to do things that were easily
    and more simply done with <colgroup>, just through sheer ignorance of
    their existence. Commonly you'll want to set alignment for a column
    of <td>s (sometimes a width too) and using a <col> avoids the need to
    repeat this on every <td>


    As for CSS, then there is no reason why you _must_ do this. No reason
    at all. It's not "better" to do this in any way - only if it gives you
    some concrete advantage as a result can you talk about there being "a
    benefit of CSS".

    CSS is also a damn nuisance unless you understand it. Tag soup can be
    a mess, but so is half-hearted CSS that's used by people who don't
    know more than how to replace <font> with it.

    The most obvious CSS benefit for tables is that it gives you more
    dimension units to choose from. Rather than just pixel or percentage
    units (or auto-size), you can also use ems or cm etc. In a world of
    varying screen sizes, using ems instead of pixels can be a valuable
    usability improvement.

    If you have many table cells to worry about, using the class attribute
    and some CSS can save you a lot of repeated width or alignment
    settings. Otherwise you can use in-lined CSS with the style
    attribute. Don't forget <col> either - it still works with CSS.

    --
    Smert' spamionam
    Andy Dingley, Aug 7, 2004
    #16
    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. Miguel Dias Moura
    Replies:
    1
    Views:
    390
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Apr 1, 2004
  2. Miguel Dias Moura
    Replies:
    1
    Views:
    406
    Lars Netzel
    Jun 18, 2004
  3. Miguel Dias Moura
    Replies:
    2
    Views:
    333
    Martin
    Jun 22, 2004
  4. Shawn
    Replies:
    8
    Views:
    379
    Shawn
    Sep 21, 2006
  5. Jaap Karssenberg

    conflict between man perlipc and man perlfunc !?

    Jaap Karssenberg, Jan 9, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    144
    Jaap Karssenberg
    Jan 9, 2004
Loading...

Share This Page