<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><section><h1>th 要素・td 要素 rowspan 属性 (HTML, XHTML 1)</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTML</anchor> の <code class="HTMLe"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">th</anchor></code> 要素および <code class="HTMLe"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">td</anchor></code>
要素の <dfn><code class="HTMLa">rowspan</code> 属性</dfn>は、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">こま</anchor>の行またぎ数 (複数の <code class="HTMLe"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">tr</anchor></code>
にまたがる範囲を一つのこまとする時の <code class="HTMLe">tr</code> の総数) を指定します。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> 仕様書:<ul><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTML 4</anchor><ul><li><code class="HTMLa">rowspan</code> 属性 <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="IW" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="HTML4:&quot;struct/tables.html#adef-rowspan&quot;">IW:HTML4:&quot;struct/tables.html#adef-rowspan&quot;</anchor-external></li><li><cite>Cells that span several rows or columns</cite> 
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="IW" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="HTML4:&quot;struct/tables.html#idx-table-11&quot;">IW:HTML4:&quot;struct/tables.html#idx-table-11&quot;</anchor-external></li><li><cite>HTML 4 Changes</cite> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="IW" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="HTML4:&quot;appendix/changes.html#h-A.1.1.7&quot;">IW:HTML4:&quot;appendix/changes.html#h-A.1.1.7&quot;</anchor-external></li></ul></li></ul></p><form xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" ref="comment"></form><section><h1>属性値</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> この属性の値は <code class="SGML"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">NUMBER</anchor></code> です。</p><p>正の数を指定すると、その数分の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">行</anchor>を占有します。
零 (<code class="HTML">0</code>) を指定すると、同じ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">行群</anchor>の残りすべてを占有します
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:">HTML 4.01 11.2.6</src>。 (以前は表の残りすべてと規定されていました
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:">HTML 4.0 11.2.6, HTML 4.01 A.1.1.7</src>。)</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> この属性は省略可能です。既定値は <code class="HTML">1</code> です。</p><form xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" ref="comment"></form></section><section><h1>例</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <pre class="HTML">&lt;TABLE border=&quot;1&quot;&gt;
&lt;TR&gt;&lt;TD&gt;1 &lt;TD rowspan=&quot;2&quot;&gt;2 &lt;TD&gt;3
&lt;TR&gt;&lt;TD&gt;4 &lt;TD&gt;6
&lt;TR&gt;&lt;TD&gt;7 &lt;TD&gt;8 &lt;TD&gt;9
&lt;/TABLE&gt;</pre></p><p>(HTML 4 仕様書より)</p><p>HTML の表では <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">LaTeX</anchor> などとは異なってまたがったこまの最初の位置
(<code class="HTMLa">rowspan</code> や <code class="HTMLa">colspan</code> のついた
<code class="HTMLe">td</code> や <code class="HTMLe">th</code> が置かれる位置)
以外の位置には目印のようなものも何も書きません。</p><p>レンダリング例:<pre>-------------
| 1 | 2 | 3 | 
----|   |----
| 4 |   | 6 |
----|---|----
| 7 | 8 | 9 |
-------------</pre></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> 用途によっては、 <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;4</anchor-internal> を<pre>-------------
| 1 | 2 | 3 | 
----|---|----
| 4 | 2 | 6 |
----|---|----
| 7 | 8 | 9 |
-------------</pre></p><p>のようにレンダリングするのもありでしょう。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> <code class="HTMLa">colspan</code> との併用ももちろん可能です。</p><pre class="HTML">&lt;TABLE border=&quot;1&quot;&gt;
&lt;TR&gt;&lt;TD&gt;1 &lt;TD rowspan=&quot;2&quot; colspan=&quot;2&quot;&gt;2
&lt;TR&gt;&lt;TD&gt;4 
&lt;TR&gt;&lt;TD&gt;7 &lt;TD&gt;8 &lt;TD&gt;9
&lt;/TABLE&gt;</pre><p>レンダリング例:<pre>-------------
| 1 | 2     | 
----|       |
| 4 |       |
----|--------
| 7 | 8 | 9 |
-------------</pre></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> またぎ数は <code class="HTML">0</code> にもできます。
(こんなの知らなかったって。いつからあるんだろう?)<pre class="HTML">&lt;TABLE border=&quot;1&quot;&gt;
&lt;TR&gt;&lt;TD&gt;1 &lt;TD rowspan=&quot;0&quot;&gt;2 &lt;TD&gt;3 
&lt;TR&gt;&lt;TD&gt;4 &lt;TD&gt;6
&lt;TR&gt;&lt;TD&gt;7 &lt;TD&gt;9
&lt;/TABLE&gt;</pre></p><p>レンダリング例:<pre>-------------
| 1 | 2 | 3 | 
----|   |----
| 4 |   | 6 |
----|   |----
| 7 |   | 9 |
-------------</pre></p><form xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" ref="comment"></form></section><section><h1>メモ</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> HTML 4 によれば、 <code class="HTMLa">rowspan</code> と <code class="HTMLa"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">colspan</anchor></code>
が重なってしまう場合は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">誤り</anchor>です。
この場合 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">UA</anchor> は好きなように処理して構わない
(逆に言えば、どう処理されるかわからない) ことになっています。</p><p>たとえば、<pre class="HTML">&lt;TABLE border=&quot;1&quot;&gt;
&lt;TR&gt;&lt;TD&gt;1 &lt;TD&gt;2 &lt;TD&gt;3
&lt;TR&gt;&lt;TD&gt;4 &lt;TD rowspan=&quot;2&quot;&gt;5 &lt;TD&gt;6
&lt;TR&gt;&lt;TD colspan=&quot;2&quot;&gt;7 &lt;TD&gt;9
&lt;/TABLE&gt;</pre></p><p>はこま 5 とこま 7 がぶつかるので誤りです。</p><form xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" ref="comment"></form></section></section><section><h1>メモ</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end>
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.re.be/css2xslfo/1_3_2/manual.pdf#page=27">http://www.re.be/css2xslfo/1_3_2/manual.pdf#page=27</anchor-external>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">名無しさん</anchor> [sage])</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> <cite><strong></strong>[<strong></strong>whatwg<strong></strong>]<strong></strong> Quirks mode handling of rowspan=&quot;0&quot;</cite>
( (<time>2012-09-03 22:21:44 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-September/037096.html">http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-September/037096.html</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> <cite><strong></strong>[<strong></strong>whatwg<strong></strong>]<strong></strong> Quirks mode handling of rowspan=&quot;0&quot;</cite>
( (<time>2012-12-11 00:46:13 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038299.html">http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038299.html</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> <cite xml:lang="en">Web Applications 1.0 r7581     rowspan=0 quirk</cite>
( (<time>2012-12-11 09:31:00 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://html5.org/tools/web-apps-tracker?from=7580&amp;to=7581">http://html5.org/tools/web-apps-tracker?from=7580&amp;to=7581</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</anchor-end> <cite xml:lang="en">Standardize special behavior of colspan/rowspan</cite>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ayg</anchor>著, <time>2017-04-26 23:28:48 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/html/commit/4fbd00f5c5a839dcde33d2820c2cd57ddefa8a6e">https://github.com/whatwg/html/commit/4fbd00f5c5a839dcde33d2820c2cd57ddefa8a6e</anchor-external></p></section></body></html>