By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

<table>: rows with differing number of columns

P: n/a
Hello,

I would like to know whether having a <table> element with two <tr> elements
each containing one <td> elements and two <td> elements, respectively, is
legal from the point of view of standard W3C HTML/XHTML. In particular,
is it legal for table rows to contain differing number of columns,
even when the colspan attribute is not used?

Thanks,

Neil
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> Hello,

I would like to know whether having a <table> element with two <tr>
elements each containing one <td> elements and two <td> elements,
respectively, is legal from the point of view of standard W3C
HTML/XHTML. In particular,
is it legal for table rows to contain differing number of columns,
even when the colspan attribute is not used?


yes it is legal,

The HTML 4.01 spec states that with respect to calculating the maximum
number of columns in the table,

"if the TABLE element contains no COLGROUP or COL elements, user agents
should base the number of columns on what is required by the rows. The
number of columns is equal to the number of columns required by the row with
the most columns, including cells that span multiple columns. For any row
that has fewer than this number of columns, the end of that row should be
padded with empty cells. The "end" of a row depends on the table
directionality."

--
BenM
http://www.benmeadowcroft.com/
Jul 20 '05 #2

P: n/a
>> Hello,

I would like to know whether having a <table> element with two <tr>
elements each containing one <td> elements and two <td> elements,
respectively, is legal from the point of view of standard W3C
HTML/XHTML. In particular,
is it legal for table rows to contain differing number of columns,
even when the colspan attribute is not used?


yes it is legal,

The HTML 4.01 spec states that with respect to calculating the maximum
number of columns in the table,

"if the TABLE element contains no COLGROUP or COL elements, user
agents should base the number of columns on what is required by the
rows. The number of columns is equal to the number of columns
required by the row with the most columns, including cells that span
multiple columns. For any row that has fewer than this number of
columns, the end of that row should be padded with empty cells. The
"end" of a row depends on the table directionality."

see http://www.w3.org/TR/html401/struct/...tml#h-11.2.4.3 for the
source

--
BenM
http://www.benmeadowcroft.com/
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.