Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-09-2003, 02:45 AM   PM User | #1
bluephoenix
New Coder

 
Join Date: Dec 2002
Location: Central New York
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
bluephoenix is an unknown quantity at this point
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
bluephoenix is offline   Reply With Quote
Old 01-09-2003, 09:43 AM   PM User | #2
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
how about

<td style="width:50px">

?
brothercake is offline   Reply With Quote
Old 01-12-2003, 05:55 AM   PM User | #3
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
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
Alex Vincent is offline   Reply With Quote
Old 01-12-2003, 10:50 PM   PM User | #4
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
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.
cg9com is offline   Reply With Quote
Old 01-12-2003, 11:21 PM   PM User | #5
jkd
Senior Coder

 
jkd's Avatar
 
Join Date: May 2002
Location: metro DC
Posts: 3,163
Thanks: 1
Thanked 18 Times in 18 Posts
jkd will become famous soon enough
Quote:
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.
__________________
jasonkarldavis.com
jkd is offline   Reply With Quote
Old 01-13-2003, 12:52 AM   PM User | #6
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
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..
brothercake is offline   Reply With Quote
Old 01-13-2003, 05:05 AM   PM User | #7
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
Quote:
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.
cg9com is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 08:07 PM.


Advertisement
Log in to turn off these ads.