Skip to content

Commit

Permalink
[] (0) How <th> elements work.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@494 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 20, 2007
1 parent d940615 commit fc47455
Show file tree
Hide file tree
Showing 2 changed files with 267 additions and 25 deletions.
132 changes: 121 additions & 11 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -14177,28 +14177,28 @@ interface <dfn id=imagedata>ImageData</dfn> {
have explicit keywords:

<dl>
<dt>The <dfn id=row title=attr-th-scope-row><code>row</code></dfn> keyword
maps to the <em>row</em> state
<dt>The <dfn id=row title=attr-th-scope-row><code>row</code></dfn>
keyword, which maps to the <em>row</em> state

<dd>The <em>row</em> state means the header cell applies to all the
remaining cells in the row.

<dt>The <dfn id=col1 title=attr-th-scope-col><code>col</code></dfn>
keyword maps to the <em><a href="#col0">col</a></em> state
keyword, which maps to the <em>column</em> state

<dd>The <em><a href="#col0">col</a></em> state means the header cell
applies to all the remaining cells in the column.

<dt>The <dfn id=rowgroup
title=attr-th-scope-rowgroup><code>rowgroup</code></dfn> keyword maps to
the <em>rowgroup</em> state
title=attr-th-scope-rowgroup><code>rowgroup</code></dfn> keyword, which
maps to the <em>row group</em> state

<dd>The <em>rowgroup</em> state means the header cell applies to all the
remaining cells in the row group.

<dt>The <dfn id=colgroup1
title=attr-th-scope-colgroup><code>colgroup</code></dfn> keyword maps to
the <em><a href="#colgroup0">colgroup</a></em> state
title=attr-th-scope-colgroup><code>colgroup</code></dfn> keyword, which
maps to the <em>column group</em> state

<dd>The <em><a href="#colgroup0">colgroup</a></em> state means the header
cell applies to all the remaining cells in the column group.
Expand Down Expand Up @@ -14316,7 +14316,7 @@ interface <dfn id=imagedata>ImageData</dfn> {
overlap each other. Similarly, <a href="#column0"
title=concept-column-group>column groups</a> cannot overlap each other.

<p>A <a href="#cell" title=concept-cell>cell</a> cannot covers slots that
<p>A <a href="#cell" title=concept-cell>cell</a> cannot cover slots that
are from two or more <a href="#row-group" title=concept-row-group>row
groups</a>. It is, however, possible for a cell to be in multiple <a
href="#column0" title=concept-column-group>column groups</a>. All the
Expand Down Expand Up @@ -14830,12 +14830,122 @@ interface <dfn id=imagedata>ImageData</dfn> {
<h5 id=header-and-data-cell-semantics><span class=secno>3.15.11.2.
</span>Forming relationships between data cells and header cells</h5>

<p>The <dfn id=algorithm2>algorithm for assigning header cells to data
cells</dfn> is as follows:
<p>Each data cell can be assigned zero or more header cells. The <dfn
id=algorithm2>algorithm for assigning header cells to data cells</dfn> is
as follows.

<p>For each header cell in the table, in <a href="#tree-order">tree
order</a>:

<ol>
<li>
<p class=big-issue>...</p>
<p>Let (<var title="">header<sub title="">x</sub></var>, <var
title="">header<sub title="">y</sub></var>) be the coordinate of the
slot to which the header cell is anchored.</p>

<li>
<p>Examine the <code title=attr-th-scope><a
href="#scope0">scope</a></code> attribute of the <code><a
href="#th0">th</a></code> element corresponding to the header cell, and,
based on its state, apply the appropriate substep:</p>

<dl class=switch>
<dt>If it is in the <em title=attr-th-scope-row><a
href="#row">row</a></em> state

<dd>
<p>Assign the header cell to any data cells anchored at slots with
coordinates (<var title="">data<sub title="">x</sub></var>, <var
title="">data<sub title="">y</sub></var>) where <span><var
title="">header<sub title="">x</sub></var>&nbsp;&lt;&nbsp;<var
title="">data<sub title="">x</sub></var>&nbsp;&le;&nbsp;<var
title="">x<sub title="">max</sub></var></span> and <span><var
title="">data<sub title="">y</sub></var>&nbsp;=&nbsp;<var
title="">header<sub title="">y</sub></var></span>.</p>

<dt>If it is in the <em title=attr-th-scope-column>column</em> state

<dd>
<p>Assign the header cell to any data cells anchored at slots with
coordinates (<var title="">data<sub title="">x</sub></var>, <var
title="">data<sub title="">y</sub></var>) where <span><var
title="">data<sub title="">x</sub></var>&nbsp;=&nbsp;<var
title="">header<sub title="">x</sub></var></span> and <span><var
title="">header<sub title="">y</sub></var>&nbsp;&lt;&nbsp;<var
title="">data<sub title="">y</sub></var>&nbsp;&le;&nbsp;<var
title="">y<sub title="">max</sub></var></span>.</p>

<dt>If it is in the <em title=attr-th-scope-rowgroup><a
href="#rowgroup">row group</a></em> state

<dd>
<p>If the header cell is not in a <a href="#row-group"
title=concept-row-group>row group</a>, then don't assign the header
cell to any data cells.</p>

<p>Otherwise, let (1, <var title="">group<sub title="">y</sub></var>)
be the slot at which the row group is anchored, let <var
title="">height</var> be the number of rows in the row group, and
assign the header cell to any data cells anchored at slots with
coordinates (<var title="">data<sub title="">x</sub></var>, <var
title="">data<sub title="">y</sub></var>) where <span><var
title="">header<sub title="">x</sub></var>&nbsp;&le;&nbsp;<var
title="">data<sub title="">x</sub></var>&nbsp;&le;&nbsp;<var
title="">x<sub title="">max</sub></var></span> and <span><var
title="">header<sub title="">y</sub></var>&nbsp;&le;&nbsp;<var
title="">data<sub title="">y</sub></var>&nbsp;&lt;&nbsp;<var
title="">group<sub title="">y</sub></var>+<var
title="">height</var></span>.</p>

<dt>If it is in the <em title=attr-th-scope-colgroup><a
href="#colgroup1">column group</a></em> state

<dd>
<p>If the header cell is not in a <a href="#column0"
title=concept-column-group>column group</a>, then don't assign the
header cell to any data cells.</p>

<p>Otherwise, let (<var title="">group<sub title="">x</sub></var>, 1)
be the slot at which the column group is anchored, let <var
title="">width</var> be the number of columns in the column group, and
assign the header cell to any data cells anchored at slots with
coordinates (<var title="">data<sub title="">x</sub></var>, <var
title="">data<sub title="">y</sub></var>) where <span><var
title="">header<sub title="">x</sub></var>&nbsp;&le;&nbsp;<var
title="">data<sub title="">x</sub></var>&nbsp;&lt;&nbsp;<var
title="">group<sub title="">x</sub></var>+<var
title="">width</var></span> and <span><var title="">header<sub
title="">y</sub></var>&nbsp;&le;&nbsp;<var title="">data<sub
title="">y</sub></var>&nbsp;&le;&nbsp;<var title="">y<sub
title="">max</sub></var></span>.</p>

<dt>Otherwise, it is in the <em title="">auto</em> state

<dd>
<p>If the header cell is not in the first row of the table, or not in
the first cell of a row, then don't assign the header cell to any data
cells.</p>

<p>Otherwise, if the header cell is in the first row of the table,
assign the header cell to any data cells anchored at slots with
coordinates (<var title="">data<sub title="">x</sub></var>, <var
title="">data<sub title="">y</sub></var>) where <span><var
title="">data<sub title="">x</sub></var>&nbsp;=&nbsp;<var
title="">header<sub title="">x</sub></var></span> and <span><var
title="">header<sub title="">y</sub></var>&nbsp;&lt;&nbsp;<var
title="">data<sub title="">y</sub></var>&nbsp;&le;&nbsp;<var
title="">y<sub title="">max</sub></var></span>.</p>

<p>Otherwise, the header cell is in the first column of the table;
assign the header cell to any data cells anchored at slots with
coordinates (<var title="">data<sub title="">x</sub></var>, <var
title="">data<sub title="">y</sub></var>) where <span><var
title="">header<sub title="">x</sub></var>&nbsp;&lt;&nbsp;<var
title="">data<sub title="">x</sub></var>&nbsp;&le;&nbsp;<var
title="">x<sub title="">max</sub></var></span> and <span><var
title="">data<sub title="">y</sub></var>&nbsp;=&nbsp;<var
title="">header<sub title="">y</sub></var></span>.</p>
</dl>
</ol>

<h3 id=forms><span class=secno>3.16. </span>Forms</h3>
Expand Down
160 changes: 146 additions & 14 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -12101,28 +12101,30 @@ interface <dfn>ImageData</dfn> {
<dl>

<dt>The <dfn title="attr-th-scope-row"><code>row</code></dfn>
keyword maps to the <em>row</em> state</dt>
keyword, which maps to the <em>row</em> state</dt>

<dd>The <em>row</em> state means the header cell applies to all the
remaining cells in the row.</dd>

<dt>The <dfn title="attr-th-scope-col"><code>col</code></dfn>
keyword maps to the <em>col</em> state</dt>
keyword, which maps to the <em>column</em> state</dt>

<dd>The <em>col</em> state means the header cell applies to all the
remaining cells in the column.</dd>

<dt>The <dfn title="attr-th-scope-rowgroup"><code>rowgroup</code></dfn>
keyword maps to the <em>rowgroup</em> state</dt>
<dt>The <dfn
title="attr-th-scope-rowgroup"><code>rowgroup</code></dfn> keyword,
which maps to the <em>row group</em> state</dt>

<dd>The <em>rowgroup</em> state means the header cell applies to all the
remaining cells in the row group.</dd>
<dd>The <em>rowgroup</em> state means the header cell applies to
all the remaining cells in the row group.</dd>

<dt>The <dfn title="attr-th-scope-colgroup"><code>colgroup</code></dfn>
keyword maps to the <em>colgroup</em> state</dt>
<dt>The <dfn
title="attr-th-scope-colgroup"><code>colgroup</code></dfn> keyword,
which maps to the <em>column group</em> state</dt>

<dd>The <em>colgroup</em> state means the header cell applies to all the
remaining cells in the column group.</dd>
<dd>The <em>colgroup</em> state means the header cell applies to
all the remaining cells in the column group.</dd>

<dt>The <em>auto</em> state</dt>

Expand Down Expand Up @@ -12241,7 +12243,7 @@ interface <dfn>ImageData</dfn> {
each other. Similarly, <span title="concept-column-group">column
groups</span> cannot overlap each other.</p>

<p>A <span title="concept-cell">cell</span> cannot covers slots that
<p>A <span title="concept-cell">cell</span> cannot cover slots that
are from two or more <span title="concept-row-group">row
groups</span>. It is, however, possible for a cell to be in multiple
<span title="concept-column-group">column groups</span>. All the
Expand Down Expand Up @@ -12950,14 +12952,144 @@ interface <dfn>ImageData</dfn> {

<h5 id="header-and-data-cell-semantics">Forming relationships between data cells and header cells</h5>

<p>The <dfn>algorithm for assigning header cells to data cells</dfn>
is as follows:</p>
<p>Each data cell can be assigned zero or more header cells. The
<dfn>algorithm for assigning header cells to data cells</dfn> is as
follows.</p>

<p>For each header cell in the table, in <span>tree
order</span>:</p>

<ol>

<li>

<p class="big-issue">...</p>
<p>Let (<var title="">header<sub title="">x</sub></var>, <var
title="">header<sub title="">y</sub></var>) be the coordinate of
the slot to which the header cell is anchored.</p>

</li>

<li>

<p>Examine the <code title="attr-th-scope">scope</code> attribute
of the <code>th</code> element corresponding to the header cell,
and, based on its state, apply the appropriate substep:</p>

<dl class="switch">

<dt>If it is in the <em title="attr-th-scope-row">row</em> state</dt>

<dd>

<p>Assign the header cell to any data cells anchored at slots
with coordinates (<var title="">data<sub title="">x</sub></var>,
<var title="">data<sub title="">y</sub></var>) where <span><var
title="">header<sub title="">x</sub></var>&nbsp;&lt;&nbsp;<var
title="">data<sub title="">x</sub></var>&nbsp;&le;&nbsp;<var
title="">x<sub title="">max</sub></var></span> and <span><var
title="">data<sub title="">y</sub></var>&nbsp;=&nbsp;<var
title="">header<sub title="">y</sub></var></span>.</p>

</dd>

<dt>If it is in the <em title="attr-th-scope-column">column</em> state</dt>

<dd>

<p>Assign the header cell to any data cells anchored at slots
with coordinates (<var title="">data<sub title="">x</sub></var>,
<var title="">data<sub title="">y</sub></var>) where <span><var
title="">data<sub title="">x</sub></var>&nbsp;=&nbsp;<var
title="">header<sub title="">x</sub></var></span> and <span><var
title="">header<sub title="">y</sub></var>&nbsp;&lt;&nbsp;<var
title="">data<sub title="">y</sub></var>&nbsp;&le;&nbsp;<var
title="">y<sub title="">max</sub></var></span>.</p>

</dd>

<dt>If it is in the <em title="attr-th-scope-rowgroup">row group</em> state</dt>

<dd>

<p>If the header cell is not in a <span
title="concept-row-group">row group</span>, then don't assign
the header cell to any data cells.</p>

<p>Otherwise, let (1, <var title="">group<sub
title="">y</sub></var>) be the slot at which the row group is
anchored, let <var title="">height</var> be the number of rows
in the row group, and assign the header cell to any data cells
anchored at slots with coordinates (<var title="">data<sub
title="">x</sub></var>, <var title="">data<sub
title="">y</sub></var>) where <span><var title="">header<sub
title="">x</sub></var>&nbsp;&le;&nbsp;<var title="">data<sub
title="">x</sub></var>&nbsp;&le;&nbsp;<var title="">x<sub
title="">max</sub></var></span> and <span><var
title="">header<sub title="">y</sub></var>&nbsp;&le;&nbsp;<var
title="">data<sub title="">y</sub></var>&nbsp;&lt;&nbsp;<var
title="">group<sub title="">y</sub></var>+<var
title="">height</var></span>.</p>

</dd>

<dt>If it is in the <em title="attr-th-scope-colgroup">column group</em> state</dt>

<dd>

<p>If the header cell is not in a <span
title="concept-column-group">column group</span>, then don't
assign the header cell to any data cells.</p>

<p>Otherwise, let (<var title="">group<sub
title="">x</sub></var>, 1) be the slot at which the column group
is anchored, let <var title="">width</var> be the number of
columns in the column group, and assign the header cell to any
data cells anchored at slots with coordinates (<var
title="">data<sub title="">x</sub></var>, <var title="">data<sub
title="">y</sub></var>) where <span><var title="">header<sub
title="">x</sub></var>&nbsp;&le;&nbsp;<var title="">data<sub
title="">x</sub></var>&nbsp;&lt;&nbsp;<var title="">group<sub
title="">x</sub></var>+<var title="">width</var></span> and
<span><var title="">header<sub
title="">y</sub></var>&nbsp;&le;&nbsp;<var title="">data<sub
title="">y</sub></var>&nbsp;&le;&nbsp;<var title="">y<sub
title="">max</sub></var></span>.</p>

</dd>

<dt>Otherwise, it is in the <em title="">auto</em> state</dt>

<dd>

<p>If the header cell is not in the first row of the table, or
not in the first cell of a row, then don't assign the header
cell to any data cells.</p>

<p>Otherwise, if the header cell is in the first row of the
table, assign the header cell to any data cells anchored at
slots with coordinates (<var title="">data<sub
title="">x</sub></var>, <var title="">data<sub
title="">y</sub></var>) where <span><var title="">data<sub
title="">x</sub></var>&nbsp;=&nbsp;<var title="">header<sub
title="">x</sub></var></span> and <span><var title="">header<sub
title="">y</sub></var>&nbsp;&lt;&nbsp;<var title="">data<sub
title="">y</sub></var>&nbsp;&le;&nbsp;<var title="">y<sub
title="">max</sub></var></span>.</p>

<p>Otherwise, the header cell is in the first column of the
table; assign the header cell to any data cells anchored at
slots with coordinates (<var title="">data<sub
title="">x</sub></var>, <var title="">data<sub
title="">y</sub></var>) where <span><var title="">header<sub
title="">x</sub></var>&nbsp;&lt;&nbsp;<var title="">data<sub
title="">x</sub></var>&nbsp;&le;&nbsp;<var title="">x<sub
title="">max</sub></var></span> and <span><var title="">data<sub
title="">y</sub></var>&nbsp;=&nbsp;<var title="">header<sub
title="">y</sub></var></span>.</p>

</dd>

</dl>

</li>

Expand Down

0 comments on commit fc47455

Please sign in to comment.