This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
(Relates to ISSUE-155/Bug 7468 - not sure if it shoudl be described as "depends on".) ISSUE-155 does not try to change HTML5's Rendering section w.r.t. <table>. However, while working with ISSUE-155, it become clear that HTML5 is out of tune with the Web even rendering wise: As <table border="0"> is frequently used on existing layout tables, HTML5's Rendering section is simply incompatible with the Web when it suggest to render any table with the @border attribute present (even when its value is "0") with a 1px border. This is HTML5's style rule for tables with the border attribute: http://dev.w3.org/html5/spec/rendering.html#decohints table[border] > tr > td, table[border] > tr > th, table[border] > thead > tr > td, table[border] > thead > tr > th, table[border] > tbody > tr > td, table[border] > tbody > tr > th, table[border] > tfoot > tr > td, table[border] > tfoot > tr > th { border-width: 1px; } Effectively, this means that <table border="0"> is to be treated as <table border="1">. Use agents: no user agents treats border="0" like that. (Tested in: Webkit [current last version], Opera 11, Firefox 4) History - HTML4: * HTML4 says that table@border with an empty value (border="") or a non-digital value (border="border") for compatibility reasons should be treated like border="1". And except for a few bugs, user agents do follow HTML4: empty @border and @border="border" *is* equal to border="1". Thus HTML5 is not incompatible with whether user agents nor *this* part of of HTML4. * However, HTML4 does also say that border="0" is equal to not using the @border attribute at all. And not only HTML4, but also the "real Web" (user agents and Web authors) do treat border="0" as equal to no @border attribute. THus, HTML5 deviates from "the Web" when it suggest to see border=0 as border=1. Examples of layout tables in the wild which contains border="0", easily found via Google: * http://www.ist-inc.com * Any layout-table based Web page produced by Freeway (http://www.softpress.com), including the 2011 release (Freeway has a table layout mode in addition to "normal" mode.) * http://wiki.services.openoffice.org/wiki/Documentation/ * http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Writer_Guide/Using_tables_for_page_layout * http://www.linuxquestions.org/ * http://www.shire.net/learnwebdesign/nocss/tables1.htm * http://www.at.ufl.edu/_archive/accessibility_cd/AccWeb/tables/layout_tables.html * http://www.thewebseye.com/using-tables.htm Tutorials of layout tables are probably few, since it is a frown-upon thing, but those pages who explain it, often suggest user of border="0": * http://www.w3schools.com/html/html_layout.asp * http://html.cita.illinois.edu/style/layout/layout-example.php * http://www.quackit.com/html/tutorial/html_layouts.cfm * http://www.shire.net/learnwebdesign/nocss/tables1.htm * http://www.thewebseye.com/using-tables.htm Proposed fix of HTML5: Simply add one more style rule for border="0", after the current style rule: table[border=0] > tr > td, table[border=0] > tr > th, table[border=0] > thead > tr > td, table[border=0] > thead > tr > th, table[border=0] > tbody > tr > td, table[border=0] > tbody > tr > th, table[border=0] > tfoot > tr > td, table[border=0] > tfoot > tr > th { border-width: 0; }
From the spec: "The table element's border attribute maps to the pixel length properties 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width' on the element. If the attribute is present but parsing the attribute's value using the rules for parsing non-negative integers generates an error, a default value of 1px is expected to be used for that property instead." i.e. border=0 maps to border-width:0 already.
(In reply to comment #1) > From the spec: > > "The table element's border attribute maps to the pixel length properties > 'border-top-width', 'border-right-width', 'border-bottom-width', > 'border-left-width' on the element. If the attribute is present but parsing the > attribute's value using the rules for parsing non-negative integers generates > an error, a default value of 1px is expected to be used for that property > instead." > > i.e. border=0 maps to border-width:0 already. Firstly: Anyone that can parse HTML5's CSS rules - see quote above - can see that table[border] td{border-width:0} results in a 0 - zero - pixel border for the table *cells*, regardless of the value or @border. Secondly, you seem to repeat what Aryeh has already remarked: http://lists.w3.org/Archives/Public/public-html/2011Mar/0616.html Namely, you [or more correctly, the spec text you quoted] speak about the borders on the very <table> container element. But otherwise, it is a very good point you have that <table border="0"> results in <table style="border-width:0">. The question then becomes: why does it not, as this bug report suggests, also result in <td style="border-width:0"> and <th style="border-width:0">?
(In reply to comment #1) > From the spec: > > "The table element's border attribute maps to the pixel length properties > 'border-top-width', 'border-right-width', 'border-bottom-width', > 'border-left-width' on the element. If the attribute is present but parsing the > attribute's value using the rules for parsing non-negative integers generates > an error, a default value of 1px is expected to be used for that property > instead." > > i.e. border=0 maps to border-width:0 already. That's what I thought originally, but Leif is right. Consider this: data:text/html,<!doctype html> <table border=15><td>A<td>B</table> <table border=0><td>A<td>B</table> The spec says that the first table should have a 15px border and the second no border, which is correct. But it says that both of them should have 1px borders on each cell, which is wrong for the latter table.
For what it's worth, you can't do the desired thing here with CSS. Gecko implemented a custom pseudo-class called :-moz-table-border-nonzero to match tables with a border attribute set. For example, border=" 0 " needs to be treated just like border="0", and there's no way to do that in CSS.
(In reply to comment #4) > For what it's worth, you can't do the desired thing here with CSS. Gecko > implemented a custom pseudo-class called :-moz-table-border-nonzero to match > tables with a border attribute set. For example, border=" 0 " needs to be > treated just like border="0", and there's no way to do that in CSS. My proposal is that @border should be defined like a normal, enumerated attribute: <table border="1"> = border-width:1px; Valid keyword value <table border="" > = border-width:1px; Valid keyword value <table border="9"> = border-width:1px; Invalid value default <table border="0"> = border-width:0; Valid keyword value <table no-border > = border-width:0; Missing value default It is pretty obvious that when a style should be derived from an enumerated attribute, then "you can do the desired thing with CSS", alone.
(In reply to comment #5) > It is pretty obvious that when a style should be derived from an enumerated > attribute, then "you can do the desired thing with CSS", alone. Err ... That was meant to be "then you _can't_ do".
Right; using the parsed integer value is what the gecko pseudo-class does, in fact.
Tab: [1] ]] > Until you provide details to the opposite, it seems most logical to > assume that you are under the same misunderstanding that Aryeh and > James once where. Indeed, there is an inconsistency in the current Rendering section, as it applies the rule about mapping @border values to 'border-width' lengths only to the <table>, not the contained cells. [[ [1] http://lists.w3.org/Archives/Public/www-archive/2011Apr/0079
I'm the https://bugzilla.wikimedia.org/show_bug.cgi?id=18829 guy. There should be both border="0" and border="1" allowed. Just like HTML4. Otherwise you all are off your rocker. To put it lightly. That's what you get for ripping up standards.
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Accepted Change Description: see diff given below Rationale: Concurred with reporter's comments. For the record, here is all that you had to say in this bug (thanks Tab and bz): "data:text/html,<!doctype html> <table border=15><td>A<td>B</table> <table border=0><td>A<td>B</table> The spec says that the first table should have a 15px border and the second no border, which is correct. But it says that both of them should have 1px borders on each cell, which is wrong for the latter table. Furthermore, for example, border=" 0 " needs to be treated just like border="0"."
Checked in as WHATWG revision r6234. Check-in comment: <table border=0> effect on <td> and <th> http://html5.org/tools/web-apps-tracker?from=6233&to=6234
AFAIK, HTML 3.0 treated the border attribute as a boolean attribute.
mass-moved component to LC1
Thanks.