Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2002
    Location
    Central New York
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XHTML Srict <td width="xx"> Work Around

    As stated in my previous post, I'm currently messing with the "company webpage." The coding is attrocious, and as I'm going through and cleaning things up I figured I might as well make it XHTML complient while I"m at it. This way the site is has solid content and a solid structure.

    Ideally, I'm a control freak, and I'd love to be able to have the code pristine XHTML Strict. As it stands now, it's XHTML Transitional.

    The problem that I've run into is with tables. I know that CSS is the way to go but I don't want to get too involved in absolute positioning and the such right now. Yet to keep the site coherant across varying screen resolutions and to help to browser to efficiently lay out elements to the screen I'm assinging width attributes to all the tables cells. .... NOT XHTML STRICT COMPLIENT!

    As the page is broken up among 3 tables, I've done not necessarily extensive but still a fair quantity of colspan and rowspan to avoid nesting, and the cells are of variying width, a CSS class attribute would seem rather absurd.

    Would anyone have any ideas of other work arounds?
    Timothy Boronczyk

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how about

    <td style="width:50px">

    ?

  • #3
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    That might work... bear in mind the style attribute itself is frowned upon. (The reason is you'd have to repeat that for every td in that column, I think, and style is meant to be a local override of normal styling.) Using a CSS stylesheet and a class attribute would be better.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #4
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    frowned upon?
    it works dont it? and perfectly valid

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.

  • #5
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by cg9com
    frowned upon?
    it works dont it? and perfectly valid
    Not in XHTML 1.1, nor do I think 1.0 Strict.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think the point about replication is the more pertinent - having to copy that attribute to each cell would be tedious. I suggested it because I inferred you'd already dismissed the class attribute for a different reason, but OTBE it would be best.

    You could always have a default, and a set of choices [and percentages are generally better]:

    td { width:50%; }
    td.twenty { width:20%; }
    td.hundred{ width:100%; }

    But personally I avoid defining the width of cells at all, as much as possible ... because global container-element definitions are harder to encapsulate against in DHTML.
    Last edited by brothercake; 01-13-2003 at 01:01 AM.

  • #7
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by jkd
    Not in XHTML 1.1, nor do I think 1.0 Strict.
    http://validator.w3.org/check?uri=ht...m%2Findex.html

    it says its valid, and i used style 10 times ...

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •