<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>12413</bug_id>
          
          <creation_ts>2011-04-04 10:50:23 +0000</creation_ts>
          <short_desc>Handling of &lt;table border=0&gt; is incompatible with the Web</short_desc>
          <delta_ts>2011-08-10 19:52:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://dev.w3.org/html5/spec/rendering.html#decohints</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Leif Halvard Silli">xn--mlform-iua</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ayg</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>james</cc>
    
    <cc>jidanni</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>xn--mlform-iua</cc>
    
    <cc>yuhongbao_386</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>47122</commentid>
    <comment_count>0</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-04-04 10:50:23 +0000</bug_when>
    <thetext>(Relates to ISSUE-155/Bug 7468 - not sure if it shoudl be described as &quot;depends on&quot;.)

ISSUE-155 does not try to change HTML5&apos;s Rendering section w.r.t. &lt;table&gt;. However, while working with ISSUE-155, it become clear that HTML5 is out of tune with the Web even rendering wise: As &lt;table border=&quot;0&quot;&gt; is frequently used on existing layout tables,  HTML5&apos;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 &quot;0&quot;) with a 1px border.

This is HTML5&apos;s style rule for tables with the border attribute: http://dev.w3.org/html5/spec/rendering.html#decohints

table[border] &gt; tr &gt; td, table[border] &gt; tr &gt; th,
table[border] &gt; thead &gt; tr &gt; td, table[border] &gt; thead &gt; tr &gt; th,
table[border] &gt; tbody &gt; tr &gt; td, table[border] &gt; tbody &gt; tr &gt; th,
table[border] &gt; tfoot &gt; tr &gt; td, table[border] &gt; tfoot &gt; tr &gt; th {
  border-width: 1px;
}

Effectively, this means that  &lt;table border=&quot;0&quot;&gt; is to be treated as &lt;table border=&quot;1&quot;&gt;.

Use agents: no user agents treats border=&quot;0&quot; like that. (Tested in: Webkit [current last version], Opera 11, Firefox 4)

History - HTML4: 
  * HTML4 says that table@border with an empty value (border=&quot;&quot;) or a non-digital value (border=&quot;border&quot;) for compatibility reasons should be treated like border=&quot;1&quot;. And except for a few bugs, user agents do follow HTML4: empty @border and @border=&quot;border&quot; *is* equal to border=&quot;1&quot;. Thus HTML5 is not incompatible with whether user agents nor *this* part of of HTML4.
  * However, HTML4 does also say that border=&quot;0&quot; is equal to not using the @border attribute at all.  And not only HTML4, but also the &quot;real Web&quot;  (user agents and Web authors) do treat border=&quot;0&quot; as equal to no @border attribute. THus, HTML5 deviates from &quot;the Web&quot; when it suggest to see border=0 as border=1.

Examples of layout tables in the wild which contains border=&quot;0&quot;,  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 &quot;normal&quot; 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=&quot;0&quot;:

 * 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=&quot;0&quot;, after the current style rule:

table[border=0] &gt; tr &gt; td, table[border=0] &gt; tr &gt; th,
table[border=0] &gt; thead &gt; tr &gt; td, table[border=0] &gt; thead &gt; tr &gt; th,
table[border=0] &gt; tbody &gt; tr &gt; td, table[border=0] &gt; tbody &gt; tr &gt; th,
table[border=0] &gt; tfoot &gt; tr &gt; td, table[border=0] &gt; tfoot &gt; tr &gt; th {
  border-width: 0;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47123</commentid>
    <comment_count>1</comment_count>
    <who name="James Graham">james</who>
    <bug_when>2011-04-04 11:07:22 +0000</bug_when>
    <thetext>From the spec:

&quot;The table element&apos;s border attribute maps to the pixel length properties &apos;border-top-width&apos;, &apos;border-right-width&apos;, &apos;border-bottom-width&apos;, &apos;border-left-width&apos; on the element. If the attribute is present but parsing the attribute&apos;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.&quot;

i.e. border=0 maps to border-width:0 already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47124</commentid>
    <comment_count>2</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-04-04 11:46:06 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; From the spec:
&gt; 
&gt; &quot;The table element&apos;s border attribute maps to the pixel length properties
&gt; &apos;border-top-width&apos;, &apos;border-right-width&apos;, &apos;border-bottom-width&apos;,
&gt; &apos;border-left-width&apos; on the element. If the attribute is present but parsing the
&gt; attribute&apos;s value using the rules for parsing non-negative integers generates
&gt; an error, a default value of 1px is expected to be used for that property
&gt; instead.&quot;
&gt; 
&gt; i.e. border=0 maps to border-width:0 already.

Firstly: Anyone that can parse HTML5&apos;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 &lt;table&gt; container element.

But otherwise, it is a very good point you have that &lt;table border=&quot;0&quot;&gt; results in &lt;table style=&quot;border-width:0&quot;&gt;. The question then becomes: why does it not, as this bug report suggests, also result in &lt;td style=&quot;border-width:0&quot;&gt; and &lt;th style=&quot;border-width:0&quot;&gt;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47131</commentid>
    <comment_count>3</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-04-04 14:16:31 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; From the spec:
&gt; 
&gt; &quot;The table element&apos;s border attribute maps to the pixel length properties
&gt; &apos;border-top-width&apos;, &apos;border-right-width&apos;, &apos;border-bottom-width&apos;,
&gt; &apos;border-left-width&apos; on the element. If the attribute is present but parsing the
&gt; attribute&apos;s value using the rules for parsing non-negative integers generates
&gt; an error, a default value of 1px is expected to be used for that property
&gt; instead.&quot;
&gt; 
&gt; i.e. border=0 maps to border-width:0 already.

That&apos;s what I thought originally, but Leif is right.  Consider this:

data:text/html,&lt;!doctype html&gt;
&lt;table border=15&gt;&lt;td&gt;A&lt;td&gt;B&lt;/table&gt;
&lt;table border=0&gt;&lt;td&gt;A&lt;td&gt;B&lt;/table&gt;

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47141</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-04-04 21:35:07 +0000</bug_when>
    <thetext>For what it&apos;s worth, you can&apos;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=&quot; 0 &quot; needs to be treated just like border=&quot;0&quot;, and there&apos;s no way to do that in CSS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47142</commentid>
    <comment_count>5</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-04-05 01:39:13 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; For what it&apos;s worth, you can&apos;t do the desired thing here with CSS.  Gecko
&gt; implemented a custom pseudo-class called :-moz-table-border-nonzero to match
&gt; tables with a border attribute set.  For example, border=&quot; 0 &quot; needs to be
&gt; treated just like border=&quot;0&quot;, and there&apos;s no way to do that in CSS.

My proposal is that @border should be defined like a normal, enumerated attribute:

&lt;table border=&quot;1&quot;&gt; = border-width:1px; Valid keyword value 
&lt;table border=&quot;&quot;  &gt; = border-width:1px; Valid keyword value
&lt;table border=&quot;9&quot;&gt; = border-width:1px; Invalid value default
&lt;table border=&quot;0&quot;&gt; = border-width:0; Valid keyword value
&lt;table no-border &gt; = border-width:0; Missing value default 

It is pretty obvious that when a style should be derived from an enumerated attribute, then &quot;you can do the desired thing with CSS&quot;, alone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47143</commentid>
    <comment_count>6</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-04-05 02:09:37 +0000</bug_when>
    <thetext>(In reply to comment #5)

&gt; It is pretty obvious that when a style should be derived from an enumerated
&gt; attribute, then &quot;you can do the desired thing with CSS&quot;, alone.

Err ... That was meant to be &quot;then you _can&apos;t_ do&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47144</commentid>
    <comment_count>7</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2011-04-05 05:23:04 +0000</bug_when>
    <thetext>Right; using the parsed integer value is what the gecko pseudo-class does, in fact.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47504</commentid>
    <comment_count>8</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-04-16 01:19:56 +0000</bug_when>
    <thetext>Tab: [1]

]]
&gt; Until you provide details to the opposite, it seems most logical to
&gt; assume that you are under the same misunderstanding that Aryeh and
&gt; James once where.

Indeed, there is an inconsistency in the current Rendering section, as
it applies the rule about mapping @border values to &apos;border-width&apos;
lengths only to the &lt;table&gt;, not the contained cells.
[[

[1] http://lists.w3.org/Archives/Public/www-archive/2011Apr/0079</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47600</commentid>
    <comment_count>9</comment_count>
    <who name="">jidanni</who>
    <bug_when>2011-04-22 03:16:07 +0000</bug_when>
    <thetext>I&apos;m the https://bugzilla.wikimedia.org/show_bug.cgi?id=18829 guy.
There should be both border=&quot;0&quot; and border=&quot;1&quot; allowed.
Just like HTML4.
Otherwise you all are off your rocker.
To put it lightly.
That&apos;s what you get for ripping up standards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49623</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-06-15 06:44:58 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;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&apos;s comments.

For the record, here is all that you had to say in this bug (thanks Tab and bz):

&quot;data:text/html,&lt;!doctype html&gt;
&lt;table border=15&gt;&lt;td&gt;A&lt;td&gt;B&lt;/table&gt;
&lt;table border=0&gt;&lt;td&gt;A&lt;td&gt;B&lt;/table&gt;

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=&quot; 0 &quot; needs to be treated just like border=&quot;0&quot;.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49624</commentid>
    <comment_count>11</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-06-15 06:46:10 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6234.
Check-in comment: &lt;table border=0&gt; effect on &lt;td&gt; and &lt;th&gt;
http://html5.org/tools/web-apps-tracker?from=6233&amp;to=6234</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50706</commentid>
    <comment_count>12</comment_count>
    <who name="Yuhong Bao">yuhongbao_386</who>
    <bug_when>2011-07-06 07:40:58 +0000</bug_when>
    <thetext>AFAIK, HTML 3.0 treated the border attribute as a boolean attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52609</commentid>
    <comment_count>13</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:03:04 +0000</bug_when>
    <thetext>mass-moved component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54624</commentid>
    <comment_count>14</comment_count>
    <who name="Leif Halvard Silli">xn--mlform-iua</who>
    <bug_when>2011-08-10 19:52:43 +0000</bug_when>
    <thetext>Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>