HighDots Forums  

Do all TRs need the same # of TDs?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Do all TRs need the same # of TDs? in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
darrel
 
Posts: n/a

Default Do all TRs need the same # of TDs? - 07-02-2004 , 10:58 AM






I've always assumed that each TR of a table needs to have the same number of
TDs in each row for the table to be valid. (Or, if not the same number of
TDs, that all the colspans + TDs add up).

I'm working in .net using a datalist with two columns. If there is an odd
number of records, the control just skips the last TD like this:

tr
td -item1- /td
td -item2- /td
/tr
tr
td -item3- /td
/tr

So, I look at this and think this is just plain wrong, but it does render OK
in the browsers, and, sure enough, it DOES validate.

I've looked through the W3C site trying to find a spec that says whether or
not each TR needs a balanced set of TDs, but I can't find anything. Anyone
have a definitive answer to this?

-Darrel



Reply With Quote
  #2  
Old   
JFK
 
Posts: n/a

Default Re: Do all TRs need the same # of TDs? - 07-02-2004 , 11:04 AM






No they do not. You can join td together in property section

"darrel" <notreal (AT) hotmail (DOT) com> wrote

Quote:
I've always assumed that each TR of a table needs to have the same number
of
TDs in each row for the table to be valid. (Or, if not the same number of
TDs, that all the colspans + TDs add up).

I'm working in .net using a datalist with two columns. If there is an odd
number of records, the control just skips the last TD like this:

tr
td -item1- /td
td -item2- /td
/tr
tr
td -item3- /td
/tr

So, I look at this and think this is just plain wrong, but it does render
OK
in the browsers, and, sure enough, it DOES validate.

I've looked through the W3C site trying to find a spec that says whether
or
not each TR needs a balanced set of TDs, but I can't find anything. Anyone
have a definitive answer to this?

-Darrel





Reply With Quote
  #3  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: Do all TRs need the same # of TDs? - 07-02-2004 , 11:10 AM



Darrel:

As far as I know, it's wrong to skip td tags like that. The rule (as I
understand it) is that the table must be internally consistent in structure.
This means that each row must contain the same number of columns (real or
spanned), and each column must contain the same number of rows (real or
spanned).

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"darrel" <notreal (AT) hotmail (DOT) com> wrote

Quote:
I've always assumed that each TR of a table needs to have the same number
of
TDs in each row for the table to be valid. (Or, if not the same number of
TDs, that all the colspans + TDs add up).

I'm working in .net using a datalist with two columns. If there is an odd
number of records, the control just skips the last TD like this:

tr
td -item1- /td
td -item2- /td
/tr
tr
td -item3- /td
/tr

So, I look at this and think this is just plain wrong, but it does render
OK
in the browsers, and, sure enough, it DOES validate.

I've looked through the W3C site trying to find a spec that says whether
or
not each TR needs a balanced set of TDs, but I can't find anything. Anyone
have a definitive answer to this?

-Darrel





Reply With Quote
  #4  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default Re: Do all TRs need the same # of TDs? - 07-02-2004 , 11:12 AM



darrel wrote:

Quote:
I've always assumed that each TR of a table needs to have the same number of
TDs in each row for the table to be valid. (Or, if not the same number of
TDs, that all the colspans + TDs add up).

I'm working in .net using a datalist with two columns. If there is an odd
number of records, the control just skips the last TD like this:

tr
td -item1- /td
td -item2- /td
/tr
tr
td -item3- /td
/tr

So, I look at this and think this is just plain wrong, but it does render OK
in the browsers, and, sure enough, it DOES validate.

I've looked through the W3C site trying to find a spec that says whether or
not each TR needs a balanced set of TDs, but I can't find anything. Anyone
have a definitive answer to this?

-Darrel


I used to have a Photoalbum software that created odd rows if needed,
and if I don't recall wrong, one or another browser didn't like when
they didn't add up. Can't remember exactly which one, though.


--
Dan Vendel - *GOF*
Contact: http://www.proformica.com/en/contact.shtml
Formmail tutorial: http://www.proformica.com/en/formmail_tutorial.shtml
Nested tables: http://www.proformica.com/en/nested_table_demo.shtml
SEO: http://www.proformica.com/en/search_engine_optimization.shtml
SE Utility: http://www.proformica.com/en/advanced_web_ranking.shtml
Search Dreamweaver newsgroup: http://www.proformica.com/google.html


Reply With Quote
  #5  
Old   
darrel
 
Posts: n/a

Default Re: Do all TRs need the same # of TDs? - 07-02-2004 , 11:17 AM



Quote:
No they do not. You can join td together in property section
When you join, then the colspan becomes 2, so they are still 'balanced' in
that sense...which is they way I thought they always had to be. But the
validator doesn't seem to mind, which has got me thinking...

-Darrel




Reply With Quote
  #6  
Old   
darrel
 
Posts: n/a

Default Re: Do all TRs need the same # of TDs? - 07-02-2004 , 11:18 AM



Quote:
As far as I know, it's wrong to skip td tags like that. The rule (as I
understand it) is that the table must be internally consistent in
structure.
This means that each row must contain the same number of columns (real or
spanned), and each column must contain the same number of rows (real or
spanned).
That's exactly what I always thought too. What bugs me is that the validator
doesn't seem to mind if the above is not true.

-Darrel




Reply With Quote
  #7  
Old   
Michael Fesser
 
Posts: n/a

Default Re: Do all TRs need the same # of TDs? - 07-02-2004 , 11:53 AM



.oO(darrel)

Quote:
I've always assumed that each TR of a table needs to have the same number of
TDs in each row for the table to be valid.
And I've always assumed that it doesn't matter (except for rendering
issues if you have visible borders). But now that you ask ... hmm.

Quote:
I'm working in .net using a datalist with two columns. If there is an odd
number of records, the control just skips the last TD like this:
[...]

So, I look at this and think this is just plain wrong, but it does render OK
in the browsers, and, sure enough, it DOES validate.
Even if it would be wrong - this is an issue a validator can't check.
The number of cells in each row/column depends on the entire structure
of the table, it becomes even more complicated if there are joined
cells. It's impossible to describe such things with a DTD or an XML
schema, a validator can only check for correct syntax, correctly nested
elements and valid attributes.

Quote:
I've looked through the W3C site trying to find a spec that says whether or
not each TR needs a balanced set of TDs, but I can't find anything. Anyone
have a definitive answer to this?
There might be something in the sections about how browsers should
determine the width and height of the table when rendering, but I'm also
still looking ...

Micha


Reply With Quote
  #8  
Old   
Chip off the Ol'Proc
 
Posts: n/a

Default Re: Do all TRs need the same # of TDs? - 07-02-2004 , 11:55 AM



As far as I know, it's wrong to skip td tags like that.
My Teacher, told me that it doesn't matter. You can deliberately make a
table with missing cells they just need to be the last cells in a row or
column.
This allows you to make a stair step (among other weird shapes) shaped table
which may desirable in some situations.
That's my 2 cents...
--
Chip off the Ol' Proc
(that's 'cessor, not 'tology)
www.1GoodReason.Com



Reply With Quote
  #9  
Old   
Michael Fesser
 
Posts: n/a

Default Re: Do all TRs need the same # of TDs? - 07-02-2004 , 12:07 PM



.oO(darrel)

Quote:
I've looked through the W3C site trying to find a spec that says whether or
not each TR needs a balanced set of TDs, but I can't find anything. Anyone
have a definitive answer to this?
There's at least an example with "missing" cells in the CSS2 spec:

17.5.1 Table layers and transparency
http://www.w3.org/TR/CSS2/tables.html#table-layers

Micha


Reply With Quote
  #10  
Old   
Joe Makowiec
 
Posts: n/a

Default Re: Do all TRs need the same # of TDs? - 07-02-2004 , 12:20 PM



On 02 Jul 2004 in macromedia.dreamweaver, darrel wrote:

Quote:
I've always assumed that each TR of a table needs to have the same
number of TDs in each row for the table to be valid. (Or, if not the
same number of TDs, that all the colspans + TDs add up).
I go along with the "I always thought it mattered" crowd. But: UAs are
relatively tolerant, and other than trying to figure out what the widths
should be in a situation like that, I'd guess it wouldn't matter *in a
simple situation such as you describe*. Which is 1 table, no nesting, no
rowspans or colspans, so that the only thing missing is the occasional
column in a given row.

As to the validator - Micha is probably correct. It would take a lot of
programming to figure out some of the more convoluted table layouts out
there. So if the table is well-formed (proper nesting, every opening tag
has a closing tag), then the number of cells per row shouldn't matter to
the validator. What it does to the UA is another question...

If I were doing this, I'd do the extra programming to be sure that each
row did have the same number of columns.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.