[1] [[HTML]] の [DFN[[CODE(HTMLe)[tr]] 要素]]は、
[[表]]の[RUBYB[[[行]]] [row]]の[[包含子]]としてはたらきます。

[5]
仕様書:
- [[HTML 4]]
-- [CSECTION[11.2.5 rows: The [CODE(HTMLe)[TR]] element]]
<IW:HTML4:"struct/tables.html#edef-TR">

[2]
:[[局所名]]:[CODE(HTMLe)[tr]]
:[[名前空間名]]:[CODE(URI)[[[http://www.w3.org/1999/xhtml]]]]
:[[開始タグ]]:必須
:[[終了タグ]]:省略可能 (HTML 4), 必須 (XHTML 1)
:[[内容模型]]:[CODE(SGML)[([CODE(HTMLe)[[[th]]]] | [CODE(HTMLe)[[[td]]]])+]]
:出現できる文脈:[CODE(HTMLe)[[[thead]]]],
[CODE(HTMLe)[[[tfoot]]]], [CODE(HTMLe)[[[tbody]]]] の直下に一つ以上
(HTML 4, XHTML 1 複雑表)。
または [CODE(HTMLe)[tbody]] のない [CODE(HTMLe)[[[table]]]]
の直下に一つ以上 (XHTML 1 簡易表)。
:[[属性]]:
,属性名	,属性値の型	,既定値	,説明	,状態	,出典
,[CODE(HTMLa)[[[align]]]]	,	,	,揃え	,[HTML4] [CODE(SGML)[%[[cellhalign]]]]
,[CODE(HTMLa)@en[[[background]]]]	,[CODE(SGML)@en[%[[URI]]]]	,(透明)	,[[背景画]]	,非標準
,[CODE(HTMLa)[[[bordercolor]]]]	,[CODE(SGML)[%[[Color]]]]	,	,境界色	,非標準
,[CODE(HTMLa)[[[bordercolordark]]]]	,[CODE(SGML)[%[[Color]]]]	,	,境界色	,非標準
,[CODE(HTMLa)[[[bordercolorlight]]]]	,[CODE(SGML)[%[[Color]]]]	,	,境界色	,非標準
,[CODE(HTMLa)[[[char]]]]	,	,	,揃える文字	,[HTML4] [CODE(SGML)[%cellhalign]]
,[CODE(HTMLa)[[[charoff]]]]	,	,	,揃える文字	,[HTML4] [CODE(SGML)[%cellhalign]]
,[CODE(HTMLa)[[[class]]]]	,	,	,[[級]]	,[HTML4] %[[coreattr]]
,[CODE(HTMLa)@en[[[cntrlrow]]]],[[ブール型属性]],[[偽]],,非標準
,[CODE(HTMLa)[[[dir]]]]	,	,	,[[書字方向]]	,[HTML4] %[[i18n]]
,[CODE(HTMLa)[[[frame]]]]	,	,	,枠	,[HTML4]
,[CODE(HTMLa)[[[id]]]]	,	,	,一意識別子	,[HTML4] %coreattr
,[CODE(HTMLa)[[[lang]]]]	,	,	,[[自然言語]]	,[HTML4] %i18n
,[CODE(HTMLa)[[[xml]]:lang]]	,	,	,自然言語	,[XHTML1]
,[CODE(HTMLa)[[[onclick]]]]	,	,	,	,[HTML4] %[[events]]
,[CODE(HTMLa)[[[ondblclick]]]]	,	,	,	,[HTML4] %events
,[CODE(HTMLa)[[[onkeydown]]]]	,	,	,	,[HTML4] %events
,[CODE(HTMLa)[[[onkeypress]]]]	,	,	,	,[HTML4] %events
,[CODE(HTMLa)[[[onkeyup]]]]	,	,	,	,[HTML4] %events
,[CODE(HTMLa)[[[onmousedown]]]]	,	,	,	,[HTML4] %events
,[CODE(HTMLa)[[[onmousemove]]]]	,	,	,	,[HTML4] %events
,[CODE(HTMLa)[[[onmouseout]]]]	,	,	,	,[HTML4] %events
,[CODE(HTMLa)[[[onmouseover]]]]	,	,	,	,[HTML4] %events
,[CODE(HTMLa)[[[onmouseup]]]]	,	,	,	,[HTML4] %events
,[CODE(HTMLa)[[[style]]]]	,	,	,スタイル情報	,[HTML4] %coreattr
,[CODE(HTMLa)[[[title]]]]	,	,	,注釈的題	,[HTML4] %coreattr
,[CODE(HTMLa)[[[valign]]]]	,	,	,垂直配置	,[HTML4] [CODE(SGML)[%[[cellvalign]]]]
,[CODE(XMLa)[[[xmlns]]]]	,[CODE(URI)[[[http://www.w3.org/1999/xhtml]]]] 固定	,==	,[[名前空間名]]	,W3C 勧告	,[[XHTML m12n]]


[[#comment]]


** 例

[3]
[PRE(HTML)[
<TABLE summary="This table charts the number of cups
                   of coffee consumed by each senator, the type 
                   of coffee (decaf or regular), and whether 
                   taken with sugar.">
<CAPTION>Cups of coffee consumed by each senator</CAPTION>
<TR> ...A header row...
<TR> ...First row of data...
<TR> ...Second row of data...
...the rest of the table...
</TABLE>
]PRE]

(HTML 4 仕様書より)


[6]

[PRE(HTML bad example code)[
<tr id="foo@example.com" onclickFn="OnClick_OnlineContact(this);" displayname="foo" status="BSY" pending="False" blocked="False" rTitle="foo@example.com" capFlag="1073856561"></tr>
]PRE]

;; 出典: [[MSN Web Messenger]], 2006年2月現在


([[名無しさん]] [sage])


[[#comment]]


** メモ

[4] [CODE(HTMLe)[tr]] に [CODE(HTMLa)[[[height]]]] 属性で高さの指定は、
できそうでできません。

[[#comment]]


* メモ

[7] [CITE@en[Let HTMLTableElement create*() and insertRow() return specific types · whatwg/html@93cb3d6]]
([TIME[2015-12-01 11:39:45 +09:00]] 版)
<https://github.com/whatwg/html/commit/93cb3d61526cf956a739c57398760dc8a3a633bd>

[8] [CITE@en[Editorial: narrow the return type of insertRow()]]
([[saschanaz]]著, [TIME[2018-04-20 23:32:44 +09:00]])
<https://github.com/whatwg/html/commit/5fa3e5cf69e141566b7e3559c2ee2192a78b3b02>

[9] [CITE@en[Narrow the return type of insertRow by saschanaz · Pull Request #3637 · whatwg/html]]
([TIME[2018-04-21 15:34:00 +09:00]])
<https://github.com/whatwg/html/pull/3637>

[10] [CITE@en[Specifiy name and description rules for td, th and tr elements - issue …]]
([[asurkov]]著, [TIME[2018-05-28 23:30:45 +09:00]])
<https://github.com/w3c/html-aam/commit/7ef3eb19602be3179b39b728494639788c9f4f36>

[11] [CITE@en[Specifiy name and description rules for td, th and tr elements - issu… by asurkov · Pull Request #132 · w3c/html-aam]]
([TIME[2018-06-01 01:04:59 +09:00]])
<https://github.com/w3c/html-aam/pull/132>

[12] [CITE@en[HTML-AAM: td and tr Name and Description Computation not specified · Issue #44 · w3c/html-aam]]
([TIME[2018-06-01 01:05:26 +09:00]])
<https://github.com/w3c/html-aam/issues/44>

[13] [CITE@en[Specifiy name and description rules for td, th and tr elements - issue …]]
([[asurkov]]著, [TIME[2018-05-28 23:30:45 +09:00]])
<https://github.com/w3c/html-aam/commit/7ef3eb19602be3179b39b728494639788c9f4f36>

[14] [CITE@en[Specifiy name and description rules for td, th and tr elements - issu… by asurkov · Pull Request #132 · w3c/html-aam]]
([TIME[2019-02-23 18:08:18 +09:00]])
<https://github.com/w3c/html-aam/pull/132>

[15] [CITE@en[HTML-AAM: td and tr Name and Description Computation not specified · Issue #44 · w3c/html-aam]]
([TIME[2019-02-23 18:08:34 +09:00]])
<https://github.com/w3c/html-aam/issues/44>

[16] [CITE@en[HTML-AAM: td and tr Name and Description Computation not specified · Issue #352 · w3c/aria]]
([TIME[2019-02-23 18:09:00 +09:00]])
<https://github.com/w3c/aria/issues/352>