HTML — テーブル用の要素

4.9. ~table状の~data

【この訳に特有な表記規約】

◎表記記号

要素の 同胞 とは、 要素と同じ親を共有している~nodeを指す。

4.9.1. `table^e 要素

`分類$
`~flow内容$ / `可触~内容$ ◎ Flow content. ◎ Palpable content.
`この要素を利用できる文脈$
`~flow内容$が期待される所。 ◎ Where flow content is expected.
`内容~model$

次の要素からなる挙げられる順による並び:

  1. 0 〜 1 個の `caption$e 要素
  2. 0 個~以上の `colgroup$e 要素
  3. 0 〜 1 個の `thead$e 要素
  4. [ 0 個~以上の `tbody$e 要素 ]または[ 1 個~以上の `tr$e 要素† ]
  5. 0 〜 1 個の `tfoot$e 要素

加えて、 これらの要素の前後には, 任意個数の`~scriptを~supportする要素$があってよい。

◎ In this order: optionally a caption element, followed by zero or more colgroup elements, followed optionally by a thead element, followed by either zero or more tbody elements or one or more tr elements, followed optionally by a tfoot element, optionally intermixed with one or more script-supporting elements.
【† ~HTML~markup内で `table^e の子として記された `tr^e の連なりは、 構文解析-時に暗黙的に生成される `tbody^e により包装され, `table^e の子にはならない。 一方で,~scriptにより `table^e の子として挿入された `tr^e は、 そのまま `table^e の子になる。 いずれにせよ、 そのような `tr^e は,`~table$内のある`~row$に対応する。 】
`text/html における~tag省略$
両~tagとも省略不可。 ◎ Neither tag is omissible.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~accessibilityの考慮点$
`table$AA ◎ For authors. For implementers.
`~DOM~interface$
[Exposed=Window]
interface `HTMLTableElement@I : `HTMLElement$I {
  [`HTMLConstructor$] constructor();

  [`CEReactions$] attribute `HTMLTableCaptionElement$I? `caption$m;
  `HTMLTableCaptionElement$I `createCaption$m();
  [`CEReactions$] undefined `deleteCaption$m();

  [`CEReactions$] attribute `HTMLTableSectionElement$I? `tHead$m;
  `HTMLTableSectionElement$I `createTHead$m();
  [`CEReactions$] undefined `deleteTHead$m();

  [`CEReactions$] attribute `HTMLTableSectionElement$I? `tFoot$m;
  `HTMLTableSectionElement$I `createTFoot$m();
  [`CEReactions$] undefined `deleteTFoot$m();

  [SameObject] readonly attribute `HTMLCollection$I `tBodies$m;
  `HTMLTableSectionElement$I `createTBody$m();

  [SameObject] readonly attribute `HTMLCollection$I `rows$m;
  `HTMLTableRowElement$I `insertRow$m(optional long %index = -1);
  [`CEReactions$] undefined `deleteRow$m(long %index);

  // `HTMLTableElement$obsMb
};

`table$e 要素は、 `~table$の形による,複数~次元の~dataを`表現-$する。 ◎ The table element represents data with more than one dimension, in the form of a table.

`table$e 要素は、 `~table~model$の一部を成す。 各~tableは、[ ~row, ~col ]たち, および それらの子孫により与えられる~cellたちからなる。 これらの[ ~row/~col ]たちは、 格子を形成する — ~tableの~cellたちは、 重合することなく,その格子を完全に占めていなければナラナイ。 ◎ The table element takes part in the table model. Tables have rows, columns, and cells given by their descendants. The rows and columns form a grid; a table's cells must completely cover that grid without overlap.

注記: この適合性~要件が満たされるかどうかを決定するための精確な規則は、 `~table~model$にて述べる。 ◎ Precise rules for determining whether this conformance requirement is met are described in the description of the table model.

作者には、[ 複階的な~tableに対しては,それをどう解釈するか述べる情報を供する ]ことが奨励される。 `そのような情報を供する方法@#table-descriptions-techniques$についての指導は下に与えられる。 ◎ Authors are encouraged to provide information describing how to interpret complex tables. Guidance on how to provide such information is given below.

~tableは、 ~layout援助として利用されてはナラナイ。 歴史的に、 一部の~web作者は,~tableを自身の~HTML~pageの~layoutを制御する仕方として誤用していたが、 そのような用法は不適合である — そのような文書から~table状の~dataを抽出しようと試みる~toolは、 見当はずれな結果を得することになるので。 特に,~screen~readerの様な~accessibility~toolの利用者にとっては、 ~page内に~layout用に利用された~tableがあると,とても~navigateし難くなると見込まれる。 ◎ Tables must not be used as layout aids. Historically, some web authors have misused tables in HTML as a way to control their page layout. This usage is non-conforming, because tools attempting to extract tabular data from such documents would obtain very confusing results. In particular, users of accessibility tools like screen readers are likely to find it very difficult to navigate pages with tables used for layout.

注記: ~HTML~tableを~layout用に利用することの代替には、 様々なものがある【!`CSS$r】 — 次に挙げるものなど ⇒# 格子~layout `CSSGRID$r, ~flex~layout `CSSFLEXBOX$r, 複柱~layout `CSSMULTICOL$r, 位置決め `CSSPOSITION$r, ~table~model `CSSTABLE$r ◎ There are a variety of alternatives to using HTML tables for layout, such as CSS grid layout, CSS flexible box layout ("flexbox"), CSS multi-column layout, CSS positioning, and the CSS table model. [CSS]


~tableは、[ 読解する/~navigateする ]のが複雑にもなり得る。 これについて利用者を補助するため、 ~UAは — 当の~tableを(不適合な)~layout用に類別した場合を除き — ~table内の~cellどうしを明瞭に描き分けるべきである。 ◎ Tables can be complicated to understand and navigate. To help users with this, user agents should clearly delineate cells in a table from each other, unless the user agent has classified the table as a (non-conforming) layout table.

注記: [ 作者/実装者 ]には、 下に述べる`~table設計-技法@#table-layout-techniques$のうち いくつかを利用して,[ 利用者にとって~tableを~navigateし易くすること ]を考慮することが奨励される。 ◎ Authors and implementers are encouraged to consider using some of the table design techniques described below to make tables easier to navigate for users.

~UA — とりわけ,任意な内容に対し~table分析を行うもの — には、 各~tableのうち[ どれが実際に~dataを包含するか, どれが単なる~layout用に利用されているか ]を決定する経験則を見出すことが奨励される。 この仕様は,精確な経験則は定義しないが、 アリな指標として,次が示唆される: ◎ User agents, especially those that do table analysis on arbitrary content, are encouraged to find heuristics to determine which tables actually contain data and which are merely being used for layout. This specification does not define a precise heuristic, but the following are suggested as possible indicators:

特能 ◎ Feature 指示 ◎ Indication
値 `presentation$v を伴う `role$a 属性が利用されている ◎ The use of the role attribute with the value presentation おそらく~layout用の~table ◎ Probably a layout table
不適合な値 0 を伴う不適合な `border$a 属性が利用されている ◎ The use of the non-conforming border attribute with the non-conforming value 0 おそらく~layout用の~table ◎ Probably a layout table
値 0 を伴う,不適合な[ `cellspacing$a / `cellpadding$a ]属性が利用されている ◎ The use of the non-conforming cellspacing and cellpadding attributes with the value 0 おそらく~layout用の~table ◎ Probably a layout table
[ `caption$e / `thead$e / `th$e ]要素が利用されている ◎ The use of caption, thead, or th elements おそらく~layout用でない~table ◎ Probably a non-layout table
[ `headers$a / `scope$a ]属性が利用されている ◎ The use of the headers and scope attributes おそらく~layout用でない~table ◎ Probably a non-layout table
0 以外の値を伴う不適合な `border$a 属性が利用されている ◎ The use of the non-conforming border attribute with a value other than 0 おそらく~layout用でない~table ◎ Probably a non-layout table
明示的に可視な~borderを設定する~CSSが利用されている ◎ Explicit visible borders set using CSS おそらく~layout用でない~table ◎ Probably a non-layout table
`summary$a 属性が利用されている ◎ The use of the summary attribute 良い指標でない (この属性は、 歴史的に,~layout用の~tableにも そうでない~tableにも与えられている) ◎ Not a good indicator (both layout and non-layout tables have historically been given this attribute)

注記: 上の示唆が誤っていることも十分あり得る。 実装者には、 ~layout用の~tableを検出する経験則を作成して,その試行-結果を詳しく調べた上で、 その経験から~feedbackを供することが督促される。 ◎ It is quite possible that the above suggestions are wrong. Implementers are urged to provide feedback elaborating on their experiences with trying to create a layout table detection heuristic.

`table$e 要素が(不適合な) `summary$a 属性を有する場合、 ~UAは — それを~layout用の~tableに類別しない場合には — 当の属性の内容を利用者に報告してもヨイ。 ◎ If a table element has a (non-conforming) summary attribute, and the user agent has not classified the table as a layout table, the user agent may report the contents of that attribute to the user.


%table.`caption$m [ = %value ]
この~tableの `caption$e 要素を返す。 ◎ Returns the table's caption element.
設定して, `caption$e 要素を置換できる。 ◎ Can be set, to replace the caption element.
%caption = %table.`createCaption()$m
この~tableは `caption$e 要素を持つようにした上で、 それを返す。 ◎ Ensures the table has a caption element, and returns it.
%table.`deleteCaption()$m
この~tableは `caption$e 要素を持たないようにする。 ◎ Ensures the table does not have a caption element.
%table.`tHead$m [ = %value ]
この~tableの `thead$e 要素を返す。 ◎ Returns the table's thead element.
設定して `thead$e 要素を置換できる。 %value が `thead$e 要素でない場合、 `HierarchyRequestError$E が投出される。 ◎ Can be set, to replace the thead element. If the new value is not a thead element, throws a "HierarchyRequestError" DOMException.
%thead = %table.`createTHead()$m
この~tableが `thead$e 要素を持つようにした上で、 それを返す。 ◎ Ensures the table has a thead element, and returns it.
%table.`deleteTHead()$m
この~tableが `thead$e 要素を持たないようにする。 ◎ Ensures the table does not have a thead element.
%table.`tFoot$m [ = %value ]
この~tableの `tfoot$e 要素を返す。 ◎ Returns the table's tfoot element.
設定して `tfoot$e 要素を置換できる。 %value が `tfoot$e 要素でない場合、 `HierarchyRequestError$E が投出される。 ◎ Can be set, to replace the tfoot element. If the new value is not a tfoot element, throws a "HierarchyRequestError" DOMException.
%tfoot = %table.`createTFoot()$m
この~tableは `tfoot$e 要素を持つようにした上で、 それを返す。 ◎ Ensures the table has a tfoot element, and returns it.
%table.`deleteTFoot()$m
この~tableは `tfoot$e 要素を持たないようにする。 ◎ Ensures the table does not have a tfoot element.
%table.`tBodies$m
この~tableの `tbody$e 要素たちからなる `HTMLCollection$I を返す。 ◎ Returns an HTMLCollection of the tbody elements of the table.
%tbody = %table.`createTBody()$m
この~tableの中に新たな `tbody$e 要素を挿入した上で、 それを返す。 ◎ Creates a tbody element, inserts it into the table, and returns it.
%table.`rows$m
この~tableの `tr$e 要素たちからなる `HTMLCollection$I を返す。 ◎ Returns an HTMLCollection of the tr elements of the table.
%tr = %table.`insertRow([ index ])$m
`tr$e 要素を作成して, それに伴い必要なら `tbody$e も作成して, それらを~tableの中の %index 番の~rowとして挿入した上で、 作成した `tr$e を返す。 ◎ Creates a tr element, along with a tbody if required, inserts them into the table at the position given by the argument, and returns the tr.
%index に対する値 −1 は、 その引数の省略-時の既定でもあり,この~tableの終端に挿入することに等価になる。 ◎ The position is relative to the rows in the table. The index −1, which is the default if the argument is omitted, is equivalent to inserting at the end of the table.
[ −1 ~LTE %index ~LTE ~rowの本数 ]でない場合、 `IndexSizeError$E が投出される。 ◎ If the given position is less than −1 or greater than the number of rows, throws an "IndexSizeError" DOMException.
%table.`deleteRow(index)$m
この~table内の %index 番の~rowである `tr$e 要素を除去する。 ◎ Removes the tr element with the given position in the table.
%index に対する値 −1 は、 この~tableの最後の~rowを削除することに等価になる。 ◎ The position is relative to the rows in the table. The index −1 is equivalent to deleting the last row of the table.
%index ~NEQ −1 であって,[ 0 ~LTE %index ~LT ~rowの本数 ]でない場合、 `IndexSizeError$E が投出される。 ◎ If the given position is less than −1 or greater than the index of the last row, or if there are no rows, throws an "IndexSizeError" DOMException.

以下における `table$e 要素 %~table の[ 属性/~method ]定義において, `新たな~table内~要素@( %局所~名 ) と記された所は、 次を意味する ⇒ `要素を作成する$( %~table の`~node文書$, %局所~名, `~HTML名前空間$ ) ◎ In all of the following attribute and method definitions, when an element is to be table-created, that means to create an element given the table element's node document, the given local name, and the HTML namespace.

`caption@m 取得子~手続きは ⇒ ~RET コレの子に `caption$e 要素は[ 在るならば それらのうち最初のもの / 無いならば ~NULL ] ◎ The caption IDL attribute must return, on getting, the first caption element child of the table element, if any, or null otherwise.\

`caption$m 設定子~手続きは:

  1. ~IF[ コレの子に `caption$e 要素は在る ] ⇒ それらのうち最初のものを除去する
  2. ~IF[ 所与の値 ~NEQ ~NULL ] ⇒ 所与の値をコレ内の最初の~nodeとして挿入する
◎ On setting, the first caption element child of the table element, if any, must be removed, and the new value, if not null, must be inserted as the first node of the table element.

`createCaption()@m ~method~手続きは:

  1. ~IF[ コレの子に `caption$e 要素は在る ] ⇒ ~RET それらのうち最初のもの
  2. %caption ~LET `新たな~table内~要素$( `caption$e )
  3. コレ内の最初の~nodeとして %caption を挿入する
  4. ~RET %caption
◎ The createCaption() method must return the first caption element child of the table element, if any; otherwise a new caption element must be table-created, inserted as the first node of the table element, and then returned.
`deleteCaption()@m ~method~手続きは: ⇒ ~IF[ コレの子に `caption$e 要素は在る ] ⇒ それらのうち最初のものを除去する ◎ The deleteCaption() method must remove the first caption element child of the table element, if any.
`tHead@m 取得子~手続きは ⇒ ~RET コレの子に `thead$e 要素は[ 在るならば それらのうち最初のもの / 無いならば ~NULL ] ◎ The tHead IDL attribute must return, on getting, the first thead element child of the table element, if any, or null otherwise.\

`tHead$m 設定子~手続きは:

  1. %thead ~LET 所与の値
  2. ~IF[ %thead ~NEQ ~NULL ]~AND[ %thead は `thead$e 要素でない ] ⇒ ~THROW `HierarchyRequestError$E
  3. コレの子に `thead$e 要素が在るならば それらのうち最初のものを除去する
  4. ~IF[ %thead ~EQ ~NULL ] ⇒ ~RET
  5. ~IF[ コレの子に[ `caption$e / `colgroup$e ]でない要素は在る ] ⇒ それらのうち最初のものの直前に %thead を挿入する
  6. ~ELSE ⇒ コレの終端に %thead を挿入する
◎ On setting, if the new value is null or a thead element, the first thead element child of the table element, if any, must be removed, and the new value, if not null, must be inserted immediately before the first element in the table element that is neither a caption element nor a colgroup element, if any, or at the end of the table if there are no such elements. If the new value is neither null nor a thead element, then a "HierarchyRequestError" DOMException must be thrown instead.

`createTHead()@m ~method~手続きは:

  1. ~IF[ コレの子に `thead$e 要素は在る ] ⇒ ~RET それらのうち最初のもの
  2. %thead ~LET `新たな~table内~要素$( `thead$e )
  3. ~IF[ コレの子に[ `caption$e / `colgroup$e ]でない要素は在る ] ⇒ それらのうち最初のものの直前に %thead を挿入する
  4. ~ELSE ⇒ コレの終端に %thead を挿入する
  5. ~RET %thead
◎ The createTHead() method must return the first thead element child of the table element, if any; otherwise a new thead element must be table-created and inserted immediately before the first element in the table element that is neither a caption element nor a colgroup element, if any, or at the end of the table if there are no such elements, and then that new element must be returned.
`deleteTHead()@m ~method~手続きは: ⇒ ~IF[ コレの子に `thead$e 要素は在る ] ⇒ それらのうち最初のものを除去する ◎ The deleteTHead() method must remove the first thead element child of the table element, if any.
`tFoot@m 取得子~手続きは ⇒ ~RET コレの子に `tfoot$e 要素は[ 在るならば それらのうち最初のもの / 無いならば ~NULL ] ◎ The tFoot IDL attribute must return, on getting, the first tfoot element child of the table element, if any, or null otherwise.\

`tFoot$m 設定子~手続きは:

  1. %tfoot ~LET 所与の値
  2. ~IF[ %tfoot ~NEQ ~NULL ]~AND[ %tfoot は `tfoot$e 要素でない ] ⇒ ~THROW `HierarchyRequestError$E
  3. コレの子に `tfoot$e 要素が在るならば それらのうち最初のものを除去する
  4. ~IF[ %tfoot ~EQ ~NULL ] ⇒ ~RET
  5. ~IF[ コレの子に[ `caption$e / `colgroup$e ]でない要素は在る ] ⇒ それらのうち最初のものの直前に %tfoot を挿入する
  6. ~ELSE ⇒ コレの終端に %tfoot を挿入する
◎ On setting, if the new value is null or a tfoot element, the first tfoot element child of the table element, if any, must be removed, and the new value, if not null, must be inserted at the end of the table. If the new value is neither null nor a tfoot element, then a "HierarchyRequestError" DOMException must be thrown instead.

`createTFoot()@m ~method~手続きは:

  1. ~IF[ コレの子に `tfoot$e 要素は在る ] ⇒ ~RET それらのうち最初のもの
  2. %tfoot ~LET `新たな~table内~要素$( `tfoot$e )
  3. コレの終端に %tfoot を挿入する
  4. ~RET %tfoot
◎ The createTFoot() method must return the first tfoot element child of the table element, if any; otherwise a new tfoot element must be table-created and inserted at the end of the table, and then that new element must be returned.
`deleteTFoot()@m ~method~手続きは ⇒ ~IF[ コレの子に `tfoot$e 要素は在る ] ⇒ それらのうち最初のものを除去する ◎ The deleteTFoot() method must remove the first tfoot element child of the table element, if any.
`tBodies@m 取得子~手続きは ⇒ ~RET 次のようにされた `HTMLCollection$I ⇒# 根 ~SET コレ, ~filterは コレの子である `tbody$e 要素に限り合致する ◎ The tBodies attribute must return an HTMLCollection rooted at the table node, whose filter matches only tbody elements that are children of the table element.

`createTBody()@m ~method~手続きは:

  1. %tbody ~LET `新たな~table内~要素$( `tbody$e )
  2. コレの子に `tbody$e 要素が[ 在るならば それらのうち最後ののものの直後 / 無いならば コレの終端 ]に %tbody を挿入する
  3. ~RET %tbody
◎ The createTBody() method must table-create a new tbody element, insert it immediately after the last tbody element child in the table element, if any, or at the end of the table element if the table element has no tbody element children, and then must return the new tbody element.

`rows@m 取得子~手続きは ⇒ ~RET 次のようにされた `HTMLCollection$I ⇒# 根 ~SET コレ, ~filterは 次に挙げるいずれかの子である `tr$e 要素に限り合致する:

  • コレ
  • コレの子である[ `thead$e / `tbody$e / `tfoot$e ]要素

返される~collectionを成す要素たちの順序は、 次に挙げる順に, かつ 各項ごとに`~tree順序$とする:

  1. `thead$e 要素の子たち
  2. コレの子たち, `tbody$e 要素の子たち
  3. `tfoot$e 要素の子たち
◎ The rows attribute must return an HTMLCollection rooted at the table node, whose filter matches only tr elements that are either children of the table element, or children of thead, tbody, or tfoot elements that are themselves children of the table element. The elements in the collection must be ordered such that those elements whose parent is a thead are included first, in tree order, followed by those elements whose parent is either a table or tbody element, again in tree order, followed finally by those elements whose parent is a tfoot element, still in tree order.

`insertRow(index)@m ~methodの挙動は、 この~tableの状態に依存する — その~method~手続きは: ◎ The behavior of the insertRow(index) method depends on the state of the table. When it is called, the method must act as required by the first item in the following list of conditions that describes the state of the table and the index argument:

  1. %~row群 ~LET コレの `rows$m ~collection ◎ ↓
  2. %N ~LET %~row群 内の要素~数 ◎ ↓
  3. ~IF[ %index ~NIN { −1 〜 %N } ] ⇒ ~THROW `IndexSizeError$E ◎ If index is less than −1 or greater than the number of elements in rows collection: • The method must throw an "IndexSizeError" DOMException.
  4. %tr ~LET `新たな~table内~要素$( `tr$e ) ◎ ↓
  5. ~IF[ %N ~EQ 0 ]~AND[ コレの子である `tbody$e 要素は無い ]:

    1. %tbody ~LET `新たな~table内~要素$( `tbody$e )
    2. %tbody に %tr を付加する
    3. コレに %tbody を付加する
    ◎ If the rows collection has zero elements in it, and the table has no tbody elements in it: • The method must table-create a tbody element, then table-create a tr element, then append the tr element to the tbody element, then append the tbody element to the table element, and finally return the tr element.
  6. ~ELIF[ %N ~EQ 0 ] ⇒ コレ内の最後の `tbody$e 要素に %tr を付加する ◎ If the rows collection has zero elements in it: • The method must table-create a tr element, append it to the last tbody element in the table, and return the tr element.
  7. ~ELIF[ %index ~IN { −1, %N } ] ⇒ %~row群 内の最後の `tr$e 要素の親に %tr を付加する ◎ If index is −1 or equal to the number of items in rows collection: • The method must table-create a tr element, and append it to the parent of the last tr element in the rows collection. Then, the newly created tr element must be returned.
  8. ~ELSE ⇒ %~row群 内の %index 番の `tr$e 要素 %E の親の中で %E の直前に %tr を挿入する ◎ Otherwise: • The method must table-create a tr element, insert it immediately before the indexth tr element in the rows collection, in the same parent, and finally must return the newly created tr element.
  9. ~RET %tr ◎ ↑

`deleteRow(index)@m ~method~手続きは:

  1. %~row群 ~LET コレの `rows$m ~collection
  2. %最大 ~LET %~row群 内の要素~数 − 1
  3. ~IF[ %index ~EQ −1 ]:

    1. ~IF[ %最大 ~EQ −1 ] ⇒ ~RET
    2. %index ~SET %最大
  4. ~ELIF[ %index ~NIN { 0 〜 %最大 } ] ⇒ ~THROW `IndexSizeError$E
  5. `~nodeを除去する$( %~row群 内の %index 番の要素 )
◎ When the deleteRow(index) method is called, the user agent must run the following steps: • If index is less than −1 or greater than or equal to the number of elements in the rows collection, then throw an "IndexSizeError" DOMException. • If index is −1, then remove the last element in the rows collection from its parent, or do nothing if the rows collection is empty. • Otherwise, remove the indexth element in the rows collection from its parent.

次の例では、 数独パズルを~mark-upするために~tableが利用されている。 ~headerを欠いていることが見て取れるが、 この種の~tableには必要yでない。 ◎ Here is an example of a table being used to mark up a Sudoku puzzle. Observe the lack of headers, which are not necessary in such a table.

`table-sudoku^xCode
4.9.1.1. ~tableを記述するための技法

単に[[ 最初の~row, 最初の~col ]内に~headerたちを伴う,~cellたちが成す格子 ]を超えるような~tableや, 一般に読者が内容を読解するには困難さがありそうな~table用には、 作者は,導入-用の説明的な情報を含めるべきある。 そのような情報は,どの利用者にも有用になるが、 ~screen~readerの利用者など,~tableを見れない利用者には とりわけ有用になる。 ◎ For tables that consist of more than just a grid of cells with headers in the first row and headers in the first column, and for any table in general where the reader might have difficulty understanding the content, authors should include explanatory information introducing the table. This information is useful for all users, but is especially useful for users who cannot see the table, e.g. users of screen readers.

そのような説明的な情報は、 次を導入するべきである:

  • 当の~tableの目的
  • 基本的な~cell構造を要旨する
  • 傾向や~patternがあれば,それを強調する
  • ~tableを利用する一般的な方法を利用者に教える
◎ Such explanatory information should introduce the purpose of the table, outline its basic cell structure, highlight any trends or patterns, and generally teach the user how to use the table.

一例として、 次の~tableでは: ◎ For instance, the following table:

`table-desc-0^dgm

この~tableの~layoutについて説明する記述から便益を得られる — 例えば次の様に ⇒ “`table-desc-caption^dgm” ◎ ...might benefit from a description explaining the way the table is laid out, something like "Characteristics are given in the second column, with the negative side in the left column and the positive side in the right column".

この情報は、 次に挙げるような種々の仕方で含めれる: ◎ There are a variety of ways to include this information, such as:

~tableの周囲の注釈文にて: ◎ In prose, surrounding the table
`table-desc-x1^xCode
~table内の `caption$e 内に: ◎ In the table's caption
`table-desc-x2^xCode
~table内の `caption$e 内の `details$e 要素~内に: ◎ In the table's caption, in a details element
`table-desc-x3^xCode
同じ `figure$e 内の,~tableの隣に: ◎ Next to the table, in the same figure
`table-desc-x4^xCode
`figure$e 内の,~tableの隣にある `figcaption$e 内に: ◎ Next to the table, in a figure's figcaption
`table-desc-x5^xCode

作者は、 上の技法との組合nも含め,他の技法を適宜~利用してもヨイ。 ◎ Authors may also use other techniques, or combinations of the above techniques, as appropriate.

もちろん,~tableの~layoutについて説明する記述を書くより、 説明が不要になるよう~tableを調整できれば最良である。 ◎ The best option, of course, rather than writing a description explaining the way the table is laid out, is to adjust the table such that no explanation is needed.

上の各~例で利用された~tableの事例では、 単純に,上端~側と左端~側に~headerが来るように~tableを配列し直せば、 説明も `headers$a 属性も不要になる: ◎ In the case of the table used in the examples above, a simple rearrangement of the table so that the headers are on the top and left sides removes the need for an explanation as well as removing the need for the use of headers attributes:

`table-desc-x6^xCode
4.9.1.2. ~tableを設計するための技法

良い~table設計は、 ~tableをより読易く かつ利用し易くするための要点になる。 ◎ Good table design is key to making tables more readable and usable.

視覚-媒体においては、 各 ~col, ~rowに~borderを供して, 各~row背景も交替的に色分けすれば、 複雑な~tableもごく効果的に読易くできる。 ◎ In visual media, providing column and row borders and alternating row backgrounds can be very effective to make complicated tables more readable.

巨大で数的な内容を伴う~tableに対しては、 等幅~fontを利用すれば — とりわけ~UAが~borderを描画しない所では — 利用者は~patternを見分け易くなり得る。 (あいにく,歴史的な理由から、 ~tableには~borderは描画しないことが共通な既定になっている。) ◎ For tables with large volumes of numeric content, using monospaced fonts can help users see patterns, especially in situations where a user agent does not render the borders. (Unfortunately, for historical reasons, not rendering borders on tables is a common default.)

発話~媒体においては、 ~tableの内容~全体を~source順に直列化するよりも,[ ~cellの内容を読取る前に,対応する~headerを報告する / ~tableの格子をなぞるように~navigate可能にする ]方が、 利用者は各~table~cellを判別し易い。 ◎ In speech media, table cells can be distinguished by reporting the corresponding headers before reading the cell's contents, and by allowing users to navigate the table in a grid fashion, rather than serializing the entire contents of the table in source order.

作者には、 ~CSSを利用して これらの効果を達成することが奨励される。 ◎ Authors are encouraged to use CSS to achieve these effects.

~pageが~CSSを利用していない場合、 ~UAには,[ ~layout用に類別されない~tableに対しては, これらの技法を利用して~tableを描画する ]ことが奨励される。 ◎ User agents are encouraged to render tables using these techniques whenever the page does not use CSS and the table is not classified as a layout table.

4.9.2. `caption^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`table$e 要素の最初の子~要素として。 ◎ As the first element child of a table element.
`内容~model$
`~flow内容$ — ただし、 子孫に `table$e 要素は無いとする。 ◎ Flow content, but with no descendant table elements.
`text/html における~tag省略$
次が満たされるならば、 `終了~tag$を省略できる ⇒ 直後に[ `~ASCII空白$/`~comment$ ]が続かない ◎ A caption element's end tag can be omitted if the caption element is not immediately followed by ASCII whitespace or a comment.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~accessibilityの考慮点$
`caption$AA ◎ For authors. For implementers.
`~DOM~interface$
[Exposed=Window]
interface `HTMLTableCaptionElement@I : `HTMLElement$I {
  [`HTMLConstructor$] constructor();

  // `HTMLTableCaptionElement$obsMb
};

`caption$e 要素は、 その親が `table$e であるならば,その~titleを`表現-$する。 ◎ The caption element represents the title of the table that is its parent, if it has a parent and that is a table element.

`caption$e 要素は、 `~table~model$の一部を成す。 ◎ The caption element takes part in the table model.

`table$e 要素が `figure$e 要素~内の`figcaption$e 以外の唯一の内容である場合、 `caption$e 要素は省略されるべきである — `figcaption$e がそれに代わるものになるので。 ◎ When a table element is the only content in a figure element other than the figcaption, the caption element should be omitted in favor of the figcaption.

~captionは,~table用の文脈を導入でき、 読解するのも有意に容易になる。 ◎ A caption can introduce context for a table, making it significantly easier to understand.

一例として、 次の~tableを考える: ◎ Consider, for instance, the following table:

`table-dice-1^dgm

この~tableは、 抽象的で明瞭でない。 しかしながら、 次のような[ (本文から`参照-$するための)~table番号を与える~captionと, 説明 ]を伴っていれば,もっとはっきりする: ◎ In the abstract, this table is not clear. However, with a caption giving the table's number (for reference in the main prose) and explaining its use, it makes more sense:

`table-dice-caption^xCode

次のものは、 利用者に もっと文脈を供する: ◎ This provides the user with more context:

`table-dice-2^dgm

4.9.3. `colgroup^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`table$e 要素の子として — ただし、 同胞に `caption$e 要素が在るならばそれより後, かつ 同胞に[ `thead$e / `tbody$e / `tfoot$e / `tr$e ]要素が在るならば それらより前に限る。 ◎ As a child of a table element, after any caption elements and before any thead, tbody, tfoot, and tr elements.
`内容~model$

この要素が `span$a 属性を

  • 有するならば、 `なし$。
  • 有さないならば、 0 個~以上の[ `col$e / `template$e ]要素。
◎ If the span attribute is present: Nothing. ◎ If the span attribute is absent: Zero or more col and template elements.
`text/html における~tag省略$

次が満たされるならば、 `開始~tag$を省略できる ⇒ [ この要素の内側にある最初のものは `col$e 要素である ]~AND[ この要素の直前に[ `終了~tag$が省略された別の `colgroup$e 要素 ]は無い ]

(この要素が空である場合は省略できない。)

◎ A colgroup element's start tag can be omitted if the first thing inside the colgroup element is a col element, and if the element is not immediately preceded by another colgroup element whose end tag has been omitted. (It can't be omitted if the element is empty.)
次が満たされるならば、 `終了~tag$を省略できる ⇒ 直後に[ `~ASCII空白$/`~comment$ ]が続かない ◎ A colgroup element's end tag can be omitted if the colgroup element is not immediately followed by ASCII whitespace or a comment.
`内容~属性$
`大域~属性$ ◎ Global attributes
`span$a — この要素が~spanする~col数 ◎ span — Number of columns spanned by the element
`~accessibilityの考慮点$
`colgroup$AA ◎ For authors. For implementers.
`~DOM~interface$
[Exposed=Window]
interface `HTMLTableColElement@I : `HTMLElement$I {
  [`HTMLConstructor$] constructor();

  [`CEReactions$] attribute unsigned long `span$m;

  // `HTMLTableColElement$obsMb
};

`colgroup$e 要素は、 その親が `table$e であるならば, 親~内の 1 個~以上の`~col$からなる`~col~group$を`表現-$する。 ◎ The colgroup element represents a group of one or more columns in the table that is its parent, if it has a parent and that is a table element.

`col$e 要素を包含しない `colgroup$e 要素には、 `span@a 内容~属性を指定してもヨイ — 指定する値は、 1 以上 1000 以下の`妥当な負でない整数$でなければナラナイ。 ◎ If the colgroup element contains no col elements, then the element may have a span content attribute specified, whose value must be a valid non-negative integer greater than zero and less than or equal to 1000.

`colgroup$e 要素, その `span$a 属性は、 `~table~model$の一部を成す。 ◎ The colgroup element and its span attribute take part in the table model.

`span@m ~IDL属性は、[ 1 以上 1000 以下に`切詰められ$,`既定の値$は 1 とする ]下で,[ `colgroup$e 要素の `span$a 内容~属性/ `col$e 要素の `~span0$a 内容~属性 ]を`反映する$モノトスル。 ◎ The span IDL attribute must reflect the content attribute of the same name. It is clamped to the range [1, 1000], and its default value is 1.

4.9.4. `col^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`~span0$a 属性を有さない `colgroup$e 要素の子として。 ◎ As a child of a colgroup element that doesn't have a span attribute.
`内容~model$
`なし$。 ◎ Nothing.
`text/html における~tag省略$
`終了~tag$は無い。 ◎ No end tag.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~span0$a — この要素が~spanする~col数 ◎ span — Number of columns spanned by the element
`~accessibilityの考慮点$
`col$AA ◎ For authors. For implementers.
`~DOM~interface$
`HTMLTableColElement$I を利用する — `colgroup$e 要素に定義されるそれと同じく。 ◎ Uses HTMLTableColElement, as defined for colgroup elements.

`col$e 要素は、[ その親は `colgroup$e 要素である, かつ そのまた親は `table$e 要素である ]ならば,[ 親の `colgroup$e により表現される`~col~group$内の 1 本~以上の`~col$ ]を`表現-$する。 ◎ If a col element has a parent and that is a colgroup element that itself has a parent that is a table element, then the col element represents one or more columns in the column group represented by that colgroup.

この要素には `~span0@a 内容~属性を指定してもヨイ — 指定する値は、 1 以上 1000 以下の`妥当な負でない整数$でなければナラナイ。 ◎ The element may have a span content attribute specified, whose value must be a valid non-negative integer greater than zero and less than or equal to 1000.

`col$e 要素, その `~span0$a 属性は、 `~table~model$の一部を成す。 ◎ The col element and its span attribute take part in the table model.

4.9.5. `tbody^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`table$e 要素の子として — ただし、 同胞に[ `caption$e / `colgroup$e / `thead$e ]要素が在るならば それらより後, かつ[ 同胞の `tr$e 要素は他に無い ]場合に限る。 ◎ As a child of a table element, after any caption, colgroup, and thead elements, but only if there are no tr elements that are children of the table element.
`内容~model$
0 個~以上の[ `tr$e 要素/ `~scriptを~supportする要素$ ]。 ◎ Zero or more tr and script-supporting elements.
`text/html における~tag省略$
次が満たされるならば、 `開始~tag$を省略できる ⇒ [ この要素の内側にある最初のものは `tr$e 要素である ]~AND[ この要素の直前に,`終了~tag$が省略された[ `tbody$e / `thead$e / `tfoot$e ]要素は無い ] ◎ A tbody element's start tag can be omitted if the first thing inside the tbody element is a tr element, and if the element is not immediately preceded by a tbody, thead, or tfoot element whose end tag has been omitted. (It can't be omitted if the element is empty.)
次が満たされるならば、 `終了~tag$を省略できる ⇒ [ この要素の直後に[ `tbody$e / `tfoot$e ]要素は在る ]~OR[ この要素の親~要素~内に,この要素に後続する内容は無い ] ◎ A tbody element's end tag can be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~accessibilityの考慮点$
`tbody$AA ◎ For authors. For implementers.
`~DOM~interface$
[Exposed=Window]
interface `HTMLTableSectionElement@I : `HTMLElement$I {
  [`HTMLConstructor$] constructor();

  [SameObject] readonly attribute `HTMLCollection$I `rows$rG;
  `HTMLTableRowElement$I `insertRow$rG(optional long index = -1);
  [`CEReactions$] undefined `deleteRow$rG(long index);

  // `HTMLTableSectionElement$obsMb
};

`HTMLTableSectionElement$I ~interfaceも[ `thead$e / `tfoot$e ]要素に対し利用される。 ◎ The HTMLTableSectionElement interface is also used for thead and tfoot elements.

`tbody$e 要素は、 その親が `table$e 要素であるならば,[ 親の本体~用の~dataからなる`~row$ ]たちが成す`~block$を`表現-$する。 ◎ The tbody element represents a block of rows that consist of a body of data for the parent table element, if the tbody element has a parent and it is a table.

`tbody$e 要素は、 `~table~model$の一部を成す。 ◎ The tbody element takes part in the table model.

%tbody.`rows$rG
この~table~row~groupを成す `tr$e 要素たちが成す `HTMLCollection$I を返す。 ◎ Returns an HTMLCollection of the tr elements of the table section.
%tr = %tbody.`insertRow([ index ])$rG
新たな `tr$e 要素を、 この~table~row~groupの中の %index 番の~rowとして挿入した上で,返す。 ◎ Creates a tr element, inserts it into the table section at the position given by the argument, and returns the tr.
%index に対する値 −1 は、 その引数の省略-時の既定でもあり, この~table~row~groupの終端に挿入することに等価になる。 ◎ The position is relative to the rows in the table section. The index −1, which is the default if the argument is omitted, is equivalent to inserting at the end of the table section.
[ −1 ~LTE %index ~LTE ~rowの本数 ]でない場合、 `IndexSizeError$E が投出される。 ◎ If the given position is less than −1 or greater than the number of rows, throws an "IndexSizeError" DOMException.
%tbody.`deleteRow(index)$rG
この~table~row~group内の %index 番の~rowである `tr$e 要素を除去する。 ◎ Removes the tr element with the given position in the table section.
%index に対する値 −1 は、 この~table~row~groupの最後の~rowを削除することに等価になる。 ◎ The position is relative to the rows in the table section. The index −1 is equivalent to deleting the last row of the table section.
%index ~NEQ −1 であって,[ 0 ~LTE %index ~LT ~rowの本数 ]でない場合、 `IndexSizeError$E が投出される。 ◎ If the given position is less than −1 or greater than the index of the last row, or if there are no rows, throws an "IndexSizeError" DOMException.
`rows@rG 取得子~手続きは ⇒ ~RET 次のようにされた `HTMLCollection$I ⇒# 根 ~SET コレ, ~filterは コレの子である `tr$e 要素に限り合致する ◎ The rows attribute must return an HTMLCollection rooted at this element, whose filter matches only tr elements that are children of this element.

`insertRow(index)@rG ~method~手続きは: ◎ The insertRow(index) method must act as follows:

  1. %~row群 ~LET コレの `rows$rG ~collection ◎ ↓
  2. %N ~LET %~row群 内の要素~数 ◎ ↓
  3. ~IF[ %index ~NIN { −1 〜 %N } ] ⇒ ~THROW `IndexSizeError$E ◎ If index is less than −1 or greater than the number of elements in the rows collection, throw an "IndexSizeError" DOMException.
  4. %~row ~LET `要素を作成する$( コレの`~node文書$, `tr$e, `~HTML名前空間$ ) ◎ Let table row be the result of creating an element given this element's node document, tr, and the HTML namespace.
  5. ~IF[ %index ~IN { −1 , %N } ] ⇒ コレに`~nodeを付加する$( %~row ) ◎ If index is −1 or equal to the number of items in the rows collection, then append table row to this element.
  6. ~ELSE ⇒ コレの中で`~nodeを子の前に挿入する$( %~row, %~row群 内の %index 番の `tr$e 要素 ) ◎ Otherwise, insert table row as a child of this element, immediately before the indexth tr element in the rows collection.
  7. ~RET %~row ◎ Return table row.

`deleteRow(index)@rG ~method~手続きは:

  1. %~row群 ~LET コレの `rows$rG ~collection
  2. %最大 ~LET %~row群 内の要素~数 − 1
  3. ~IF[ %index ~EQ −1 ]:

    1. ~IF[ %最大 ~EQ −1 ] ⇒ ~RET
    2. %index ~SET %最大
  4. ~ELIF[ %index ~NIN { 0 〜 %最大 } ] ⇒ ~THROW `IndexSizeError$E
  5. `~nodeを除去する$( %~row群 内の %index 番の要素 )
◎ The deleteRow(index) method must, when invoked, act as follows: • If index is less than −1 or greater than or equal to the number of elements in the rows collection, then throw an "IndexSizeError" DOMException. • If index is −1, then remove the last element in the rows collection from this element, or do nothing if the rows collection is empty. • Otherwise, remove the indexth element in the rows collection from this element.

4.9.6. `thead^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`table$e 要素の子として — ただし、 同胞に[ `caption$e/`colgroup$e ]要素が在るならば それらより後, かつ 同胞に[ `tbody$e / `tfoot$e / `tr$e ]要素が在るならば それらより前, かつ[ 同胞の `thead$e 要素は他に無い ]場合に限る。 ◎ As a child of a table element, after any caption, and colgroup elements and before any tbody, tfoot, and tr elements, but only if there are no other thead elements that are children of the table element.
`内容~model$
0 個~以上の[ `tr$e 要素 / `~scriptを~supportする要素$ ]。 ◎ Zero or more tr and script-supporting elements.
`text/html における~tag省略$
次が満たされるならば、 `終了~tag$を省略できる ⇒ 直後に[ `tbody$e / `tfoot$e ]要素が続く ◎ A thead element's end tag can be omitted if the thead element is immediately followed by a tbody or tfoot element.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~accessibilityの考慮点$
`thead$AA ◎ For authors. For implementers.
`~DOM~interface$
`HTMLTableSectionElement$I を利用する — `tbody$e 要素に定義されるそれと同じく。 ◎ Uses HTMLTableSectionElement, as defined for tbody elements.

`thead$e 要素は、 その親は `table$e 要素であるならば,親~用の[ 各~col用の~label(~header)たち, 従属的な非-~header~cellたち ]からなる`~row$たちが成す`~block$を`表現-$する。 ◎ The thead element represents the block of rows that consist of the column labels (headers) and any ancillary non-header cells for the parent table element, if the thead element has a parent and it is a table.

`thead$e 要素は、 `~table~model$の一部を成す。 ◎ The thead element takes part in the table model.

`thead$e 要素の用例を次に示す。 `thead$e 要素~内に[ `th$e, `td$e ]両~要素とも利用していることに着目されたし: 1 本目の~rowは,~headerたちを与え、 2 本目の~rowは,~table内の各~欄をどう埋めるかについて説明を与えている: ◎ This example shows a thead element being used. Notice the use of both th and td elements in the thead element: the first row is the headers, and the second row is an explanation of how to fill in the table.

`thead-1^xCode

4.9.7. `tfoot^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`table$e 要素の子として — ただし、 同胞に[ `caption$e / `colgroup$e / `thead$e / `tbody$e / `tr$e ]要素が在るならば それらより後, かつ[ 同胞の `tfoot$e 要素は他に無い ]場合に限る。 ◎ As a child of a table element, after any caption, colgroup, thead, tbody, and tr elements, but only if there are no other tfoot elements that are children of the table element.
`内容~model$
0 個~以上の[ `tr$e 要素 / `~scriptを~supportする要素$ ]。 ◎ Zero or more tr and script-supporting elements.
`text/html における~tag省略$
次が満たされるならば、 `終了~tag$を省略できる ⇒ 親~要素~内に,この要素に後続する内容は無い ◎ A tfoot element's end tag can be omitted if there is no more content in the parent element.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~accessibilityの考慮点$
`tfoot$AA ◎ For authors. For implementers.
`~DOM~interface$
`HTMLTableSectionElement$I を利用する — `tbody$e 要素に定義されるそれと同じく。 ◎ Uses HTMLTableSectionElement, as defined for tbody elements.

`tfoot$e 要素は、 その親は `table$e 要素であるならば,[ 親の各~col用の要約(~footer)からなる`~row$ ]たちが成す`~block$を`表現-$する。 ◎ The tfoot element represents the block of rows that consist of the column summaries (footers) for the parent table element, if the tfoot element has a parent and it is a table.

`tfoot$e 要素は、 `~table~model$の一部を成す。 ◎ The tfoot element takes part in the table model.

4.9.8. `tr^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`thead$e 要素の子として。 ◎ As a child of a thead element.
`tbody$e 要素の子として。 ◎ As a child of a tbody element.
`tfoot$e 要素の子として。 ◎ As a child of a tfoot element.
`table$e 要素の子として — ただし、 同胞に[ `caption$e / `colgroup$e / `thead$e ]要素が在るならば それらより後, かつ[ 同胞の `tbody$e 要素は他に無い ]場合に限る。 ◎ As a child of a table element, after any caption, colgroup, and thead elements, but only if there are no tbody elements that are children of the table element.
`内容~model$
0 個~以上の[ `td$e 要素 / `th$e 要素 / `~scriptを~supportする要素$ ]。 ◎ Zero or more td, th, and script-supporting elements.
`text/html における~tag省略$
次が満たされるならば、 `終了~tag$を省略できる ⇒ [ 直後に[ 別の `tr$e ]要素が続く ]~OR[ 親~要素~内に,この要素に後続する内容は無い ] ◎ A tr element's end tag can be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element.
`内容~属性$
`大域~属性$ ◎ Global attributes
`~accessibilityの考慮点$
`tr$AA ◎ For authors. For implementers.
`~DOM~interface$
[Exposed=Window]
interface `HTMLTableRowElement@I : `HTMLElement$I {
  [`HTMLConstructor$] constructor();

  readonly attribute long `rowIndex$m;
  readonly attribute long `sectionRowIndex$m;
  [SameObject] readonly attribute `HTMLCollection$I `cells$m;
  `HTMLTableCellElement$I `insertCell$m(optional long %index = -1);
  [`CEReactions$] undefined `deleteCell$m(long %index);

  // `HTMLTableRowElement$obsMb
};

`tr$e 要素は、 `~table$内の ある[ `~cell$たちが成す`~row$ ]を`表現-$する。 ◎ The tr element represents a row of cells in a table.

`tr$e 要素は、 `~table~model$の一部を成す。 ◎ The tr element takes part in the table model.

%tr.`rowIndex$m
この~rowが属する~tableの `rows$m ~collectionにおける,この~rowの~indexを返す。 ◎ Returns the position of the row in the table's rows list.
この要素が~table内にない場合は −1 を返す。 ◎ Returns −1 if the element isn't in a table.
%tr.`sectionRowIndex$m
この~rowが属する~table~row~groupの `rows$rG ~collectionにおける この~rowの~indexを返す。 ◎ Returns the position of the row in the table section's rows list.
この要素が~table~row~group内に無い場合は −1 を返す。 ◎ Returns −1 if the element isn't in a table section.
%tr.`cells$m
この~row内の[ `td$e / `th$e ]要素からなる `HTMLCollection$I を返す。 ◎ Returns an HTMLCollection of the td and th elements of the row.
%cell = %tr.`insertCell([ index ])$m
新たな `td$e 要素を、 この~table~rowの中の %index 番の~cellとして挿入した上で,返す。 ◎ Creates a td element, inserts it into the table row at the position given by the argument, and returns the td.
%index に対する値 −1 は、 その引数の省略-時の既定でもあり, この~rowの終端に挿入することに等価になる。 ◎ The position is relative to the cells in the row. The index −1, which is the default if the argument is omitted, is equivalent to inserting at the end of the row.
[ −1 ~LTE %index ~LTE ~cellの個数 ]でない場合、 `IndexSizeError$E が投出される。 ◎ If the given position is less than −1 or greater than the number of cells, throws an "IndexSizeError" DOMException.
%tr.`deleteCell(index)$m
この~row内の %index 番の~cellである[ `td$e / `th$e ]要素を除去する。 ◎ Removes the td or th element with the given position in the row.
%index に対する値 −1 は、 この~row内の最後の~cellを削除することに等価になる。 ◎ The position is relative to the cells in the row. The index −1 is equivalent to deleting the last cell of the row.
%index ~NEQ −1 であって,[ 0 ~LTE %index ~LT ~cellの個数 ]でない場合、 `IndexSizeError$E が投出される。 ◎ If the given position is less than −1 or greater than the index of the last cell, or if there are no cells, throws an "IndexSizeError" DOMException.

`rowIndex@m 取得子~手続きは:

  1. %親 ~LET コレの親
  2. ~IF[ %親 は[ `tbody$e / `thead$e / `tfoot$e ]要素である ] ⇒ %親 ~LET %親 の親
  3. ~IF[ %親 は `table$e 要素である ] ⇒ ~RET %親 の `rows$m ~collectionにおける コレの~index
  4. ~RET −1
◎ The rowIndex attribute must, if this element has a parent table element, or a parent tbody, thead, or tfoot element and a grandparent table element, return the index of this tr element in that table element's rows collection. If there is no such table element, then the attribute must return −1.

`sectionRowIndex@m 取得子~手続きは:

  1. %親 ~LET コレの親
  2. ~IF[ %親 は `table$e 要素である ] ⇒ ~RET %親 ( `HTMLTableElement$I )の `rows$m ~collectionにおける コレの~index
  3. ~IF[ %親 は[ `tbody$e / `thead$e / `tfoot$e ]要素である ] ⇒ ~RET %親 ( `HTMLTableSectionElement$I )の `rows$rG ~collectionにおける コレの~index
  4. ~RET −1
◎ The sectionRowIndex attribute must, if this element has a parent table, tbody, thead, or tfoot element, return the index of the tr element in the parent element's rows collection (for tables, that's HTMLTableElement's rows collection; for table sections, that's HTMLTableSectionElement's rows collection). If there is no such parent element, then the attribute must return −1.
`cells@m 取得子~手続きは ⇒ ~RET 次のようにされた `HTMLCollection$I ⇒# 根 ~SET コレ, ~filterは コレの子である[ `td$e / `th$e ]要素に限り合致する ◎ The cells attribute must return an HTMLCollection rooted at this tr element, whose filter matches only td and th elements that are children of the tr element.

`insertCell(index)@m ~method~手続きは: ◎ The insertCell(index) method must act as follows:

  1. %~cell群 ~LET コレの `cells$m ~collection ◎ ↓
  2. %N ~LET %~cell群 内の要素~数 ◎ ↓
  3. ~IF[ %index ~NIN { −1 〜 %N } ] ⇒ ~THROW `IndexSizeError$E ◎ If index is less than −1 or greater than the number of elements in the cells collection, then throw an "IndexSizeError" DOMException.
  4. %~cell ~LET `要素を作成する$( コレの`~node文書$, `td$e, `~HTML名前空間$ ) ◎ Let table cell be the result of creating an element given this tr element's node document, td, and the HTML namespace.
  5. ~IF[ %index ~IN { −1, %N } ] ⇒ コレに`~nodeを付加する$( %~cell ) ◎ If index is equal to −1 or equal to the number of items in cells collection, then append table cell to this tr element.
  6. ~ELSE ⇒ コレの中で`~nodeを子の前に挿入する$( %~cell, %~cell群 内の %index 番の[ `td$e / `th$e ]要素 ) ◎ Otherwise, insert table cell as a child of this tr element, immediately before the indexth td or th element in the cells collection.
  7. ~RET %~cell ◎ Return table cell.

`deleteCell(index)@m ~method~手続きは:

  1. %~cell群 ~LET コレの `cells$m ~collection
  2. %最大 ~LET %~cell群 内の要素~数 − 1
  3. ~IF[ %index ~EQ −1 ]:

    1. ~IF[ %最大 ~EQ −1 ] ⇒ ~RET
    2. %index ~SET %最大
  4. ~ELIF[ %index ~NIN { 0 〜 %最大 } ] ⇒ ~THROW `IndexSizeError$E
  5. %~cell ~LET %~cell群 内の %index 番の要素
  6. `~nodeを除去する$( %~cell )
◎ The deleteCell(index) method must act as follows: • If index is less than −1 or greater than or equal to the number of elements in the cells collection, then throw an "IndexSizeError" DOMException. • If index is −1, then remove the last element in the cells collection from its parent, or do nothing if the cells collection is empty. • Otherwise, remove the indexth element in the cells collection from its parent.

4.9.9. `td^e 要素

`分類$
なし ◎ None.
`この要素を利用できる文脈$
`tr$e 要素の子として。 ◎ As a child of a tr element.
`内容~model$
`~flow内容$ 。 ◎ Flow content.
`text/html における~tag省略$
次が満たされるならば、 `終了~tag$を省略できる ⇒ [ 直後に[ `td$e / `th$e ]要素が続く ]~OR[ 親~要素~内に,この要素に後続する内容は無い ] ◎ A td element's end tag can be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element.
`内容~属性$
`大域~属性$ ◎ Global attributes
`colspan$a — この~cellが~spanする~col数 ◎ colspan — Number of columns that the cell is to span
`rowspan$a — この~cellが~spanする~row数 ◎ rowspan — Number of rows that the cell is to span
`headers$a — この~cellに対する~header~cellたち ◎ headers — The header cells for this cell
`~accessibilityの考慮点$
`td$AA ◎ For authors. For implementers.
`~DOM~interface$
[Exposed=Window]
interface `HTMLTableCellElement@I : `HTMLElement$I {
  [`HTMLConstructor$] constructor();

  [`CEReactions$] attribute unsigned long `colSpan$m;
  [`CEReactions$] attribute unsigned long `rowSpan$m;
  [`CEReactions$] attribute DOMString `headers$m;
  readonly attribute long `cellIndex$m;

  [`CEReactions$] attribute DOMString `scope$m; /* 
`th^e 要素~用に限り適合する
◎
only conforming for th elements
 */
  [`CEReactions$] attribute DOMString `abbr$m;  /* 
`th^e 要素~用に限り適合する
◎
only conforming for th elements
 */

  // `HTMLTableCellElement$obsMb
};

`HTMLTableCellElement$I ~interfaceは `th$e 要素にも利用される。 ◎ The HTMLTableCellElement interface is also used for th elements.

`td$e 要素は、 ~table内の~data `~cell$を`表現-$する。 ◎ The td element represents a data cell in a table.

`td$e 要素, その[ `colspan$a, `rowspan$a, `headers$a ]属性は、 `~table~model$の一部を成す。 ◎ The td element and its colspan, rowspan, and headers attributes take part in the table model.

~UAは、[ とりわけ視覚的でない環境/ ~tableを二次元の格子として表示すると実用的にならない所 ]では、 ~cellの内容を描画するときに,当の~cell用の利用者~文脈を与えてもヨイ。 一例として、[ `~table~model$における当の~cellの位置を与える/ 当の~cellに`アテガわれた~header~cellたち@#algorithm-for-assigning-header-cells$を挙げる ]など。 ~UAは、 そのような~header~cellが `abbr$a 属性を有する場合には, ~header~cellの内容に代えて その属性~値を利用してもヨイ。 ◎ User agents, especially in non-visual environments or where displaying the table as a 2D grid is impractical, may give the user context for the cell when rendering the contents of a cell; for instance, giving its position in the table model, or listing the cell's header cells (as determined by the algorithm for assigning header cells). When a cell's header cells are being listed, user agents may use the value of abbr attributes on those header cells, if any, instead of the contents of the header cells themselves.

次の例では、 ある~web~appの~code片を見てみる。 それは、 編集-可能な~cellたちが成す格子である (本質的には単純な~spreadsheet)。 最初の 2 個の~cell, 最後手前にある 1 個の~cellは、 `td$e 要素の代わりに `th$e 要素を利用して, 見出しとして~markされている。 最後の~cellは、[ その上にある一連の~cell ]の総和を示すよう環境設定されている — ~scriptは、 その合計を保守するために, これらの要素に~event~handlerを~~登録することになろう。 ◎ In this example, we see a snippet of a web application consisting of a grid of editable cells (essentially a simple spreadsheet). One of the cells has been configured to show the sum of the cells above it. Three have been marked as headings, which use th elements instead of td elements. A script would attach event handlers to these elements to maintain the total.

`td-1^xCode

4.9.10. `th^e 要素

`分類$
なし。 ◎ None.
`この要素を利用できる文脈$
`tr$e 要素の子として。 ◎ As a child of a tr element.
`内容~model$
`~flow内容$ — ただし,子孫に次に挙げるものは無いとする ⇒ `header$e 要素/ `footer$e 要素/ `~sectioning内容$ / `~header内容$ ◎ Flow content, but with no header, footer, sectioning content, or heading content descendants.
`text/html における~tag省略$
次が満たされるならば、 `終了~tag$を省略できる ⇒ [ 直後に[ `td$e / `th$e ]要素が続く ]~OR[ 親~要素~内に,この要素に後続する内容は無い ] ◎ A th element's end tag can be omitted if the th element is immediately followed by a td or th element, or if there is no more content in the parent element.
`内容~属性$
`大域~属性$ ◎ Global attributes
`colspan$a — この~cellが~spanする~col数 ◎ colspan — Number of columns that the cell is to span
`rowspan$a — この~cellが~spanする~row数 ◎ rowspan — Number of rows that the cell is to span
`headers$a — この~cellに対する~header~cellたち ◎ headers — The header cells for this cell
`scope$a — この~header~cellをどの~cellたちに適用するかを指定する ◎ scope — Specifies which cells the header cell applies to
`abbr$a — 他の文脈にて この~header~cellを参照するときに,~headerとして利用する代替~labelを与える。 ◎ abbr — Alternative label to use for the header cell when referencing the cell in other contexts
`~accessibilityの考慮点$
`th$AA ◎ For authors. For implementers.
`~DOM~interface$
`HTMLTableCellElement$I を利用する — `td$e 要素に定義されるそれと同じく。 ◎ Uses HTMLTableCellElement, as defined for td elements.

`th$e 要素は、 ~table内の~header`~cell$を`表現-$する。 ◎ The th element represents a header cell in a table.

`th$e 要素には `scope@a 内容~属性を指定してもヨイ。 ◎ The th element may have a scope content attribute specified.

この属性は,`列挙d属性$であり、 次に挙げる~keyword, とり得る状態, それらの対応付けが定義される: ◎ The scope attribute is an enumerated attribute with the following keywords and states:

~keyword 状態 概略的な記述 — 要素が表現する~header~cellは、 どの~cellたちに適用されるか
`row@v `Row@st 当の~cellと同じ~row(たち)内の後続な~cellたちのうち一部。
`column@v `Column@st 当の~cellと同じ~col(たち)内の後続な~cellたちのうち一部。
`rowgroup@v `Rowgroup@st 当の~cellが属する`~row~group$内の以降の~cellすべて。
`colgroup@v `Colgroup@st 当の~cellが属する`~col~group$内の以降の~cellすべて。
`auto@v `Auto@st 文脈に基づいて選定される~cellたち。

【 ~keywordと状態との対応関係を簡明にするため、 この訳では,状態~名を[ 単に,~keywordの先頭の文字を大文字にしただけの名前 ]で表記する。 】

◎ Keyword|State|Brief description row|row|The header cell applies to some of the subsequent cells in the same row(s). col|column|The header cell applies to some of the subsequent cells in the same column(s). rowgroup|row group|The header cell applies to all the remaining cells in the row group. colgroup|column group|The header cell applies to all the remaining cells in the column group. auto|auto|The header cell applies to a set of cells selected based on context.

この属性の[ `欠落~値~用の既定の状態$/`妥当でない値~用の既定の状態$ ]は、 `Auto$st とする。 ◎ The attribute's missing value default and invalid value default are both the auto state.

`th$e 要素の `scope$a 属性の状態は、 要素の~anchorが[ `~row~group$/`~col~group$ ]内に無い場合は,[ `Rowgroup$st / `Colgroup$st ]になってはナラナイ。 ◎ A th element's scope attribute must not be in the row group state if the element is not anchored in a row group, nor in the column group state if the element is not anchored in a column group.

【 ~UA要件か作者~要件か判別し難いが、 満たされない場合の状態が指定されていないので,後者に思われる (~UAは、満たされない場合でも,定義された状態に則って挙動すると思われる)。 】【 ~anchorとは、 当の`~cell$が占める最初の`~slot@#concept-slots$を指す (上の表tに現れる “属する” も、 当の~cellの~anchorが属することを意味する)。 】

`th$e 要素には `abbr@a 内容~属性を指定してもヨイ。 指定する値は、[ 他の文脈にて この~cellを参照するときに~headerに利用するための, この~header~cell用の代替~label ]でなければナラナイ(例: ある~data~cellに適用される~header~cellたちを記述するとき)。 概して,~header~cellの全部的な内容の略称-形であるが、 追記, あるいは単なる言い換えにもなり得る。 ◎ The th element may have an abbr content attribute specified. Its value must be an alternative label for the header cell, to be used when referencing the cell in other contexts (e.g. when describing the header cells that apply to a data cell). It is typically an abbreviated form of the full header cell, but can also be an expansion, or merely a different phrasing.

`th$e 要素, その[ `colspan$a, `rowspan$a, `headers$a, `scope$a ]属性は、 `~table~model$の一部を成す。 ◎ The th element and its colspan, rowspan, headers, and scope attributes take part in the table model.

次の例に、[ どの~data~cellたちに~header~cellが適用されるか ]に, `scope$a 属性の `rowgroup$v 値がどう影響するかを示す: ◎ The following example shows how the scope attribute's rowgroup value affects which data cells a header cell applies to.

まずは、 ~tableの~markup片を示す: ◎ Here is a markup fragment showing a table:

`th-1^xCode

結果は、 次のようになる: ◎ This would result in the following table:

`th-1^dgm
  • 最初の~row内の~headerは、 各~cellのうち[ 以降の~rowにある, かつ同じ~col内にあるもの ]すべてに適用される。 ◎ The headers in the first row all apply directly down to the rows in their column.
  • `scope$a 属性が `rowgroup$v 状態にある~headerは、 各~cellのうち[ 最初の~col内には無い, かつ同じ~row~group内に在るもの ]すべてに適用される。 ◎ The headers with a scope attribute in the rowgroup state apply to all the cells in their row group other than the cells in the first column.
  • 他の~header( `scope$a 属性は `row^v )は、 単に,同じ~row内にある以降の~cellに適用される。 ◎ The remaining headers apply just to the cells to the right of them.
`table-scope-diagram^dgm

4.9.11. `td^e, `th^e 要素に共通な属性

[ `td$e / `th$e ]要素には、 `colspan@a 内容~属性を指定してもヨイ — 指定する値は、 1 以上 1000 以下の`妥当な負でない整数$でなければナラナイ。 この属性は、 この~cellが~spanする~col数を与える。 ◎ The td and th elements may have a colspan content attribute specified, whose value must be a valid non-negative integer greater than zero and less than or equal to 1000.

[ `td$e / `th$e ]要素には、 `rowspan@a 内容~属性を指定してもヨイ — 指定する値は、 65534 以下の`妥当な負でない整数$でなければナラナイ。 この属性は、 この~cellが~spanする~row数を与える。 この属性に対する値 0 は、 この~cellが[ この~cellが~spanする~col内, かつ この~cellが属する~row~group内の,以降の~rowすべて ]に~spanすることを意味する。 ◎ The td and th elements may also have a rowspan content attribute specified, whose value must be a valid non-negative integer less than or equal to 65534. For this attribute, the value zero means that the cell is to span all the remaining rows in the row group.

これらの属性を利用するときは、 `~table~model$に述べるとおり,~cellどうしが重合してはナラナイ。 ◎ These attributes give the number of columns and rows respectively that the cell is to span. These attributes must not be used to overlap cells, as described in the description of the table model.


[ `td$e / `th$e ]要素には `headers@a 内容~属性を指定してもヨイ — 指定する値は、 `~space等で分離された~token集合$(一意)であって, それを成す どの~tokenも[ 当の要素と同じ`~table$の一部を成している(`~table~model$にて定義される), ある `th$e 要素 ]の`~ID$の値を与えていなければナラナイ。 ◎ The td and th element may have a headers content attribute specified. The headers attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens, none of which are identical to another token and each of which must have the value of an ID of a th element taking part in the same table as the td or th element (as defined by the table model).

`th$e 要素は自身から`指されて^iいてはナラナイ — ここで, %A は %B から`指されて^iいるとは、 ( %A, %B ) が ~OR↓ を満たすことを意味する:

  • %A は %B から `直に指されて^i いる
  • 次を満たす ある %C が存在する ⇒ [ %A は %C から`直に指されて^iいる ]~AND[ %C は %B から`指されて^iいる ]

ここで, %A は %B から `直に指されて^iいるとは、 ~AND↓ が満たされることを意味する:

  • %A は `th$e 要素である
  • %B は[ `th$e / `td$e ]要素である
  • %A, %B は同じ `~table$内にある
  • %A の`~ID$ ~NEQ ε
  • %B は `headers$a 属性を有する
  • %A の`~ID$ ~IN { %B の `headers$a 属性の値を成す~tokenたち }

【 %A と %B が異なることは必要yでない。 】

◎ A th element with ID id is said to be directly targeted by all td and th elements in the same table that have headers attributes whose values include as one of their tokens the ID id. A th element A is said to be targeted by a th or td element B if either A is directly targeted by B or if there exists an element C that is itself targeted by the element B and A is directly targeted by C. ◎ A th element must not be targeted by itself.

[ `colspan$a, `rowspan$a, `headers$a ]属性は、 `~table~model$の一部を成す。 ◎ The colspan, rowspan, and headers attributes take part in the table model.


%cell.`cellIndex$m
この~cellが属する~rowの `cells$m ~collectionにおける,この~cellの~indexを返す。 これは、 この~cellの[ ~tableにおける~x座標 ]に対応するとは限らない — それより前にある~cellが,複数の[ ~row/~col ]を占めることもあるので。 ◎ Returns the position of the cell in the row's cells list. This does not necessarily correspond to the x-position of the cell in the table, since earlier cells might cover multiple rows or columns.
要素が どの~rowにも属さない場合、 −1 を返す。 ◎ Returns −1 if the element isn't in a row.

`colSpan@m ~IDL属性は、[ 1 以上 1000 以下に`切詰められ$,`既定の値$は 1 とする ]下で, `colspan$a 内容~属性を`反映する$モノトスル。 ◎ The colSpan IDL attribute must reflect the colspan content attribute. It is clamped to the range [1, 1000], and its default value is 1.

`rowSpan@m ~IDL属性は、[ 0 以上 65534 以下に`切詰められ$,`既定の値$は 1 とする ]下で, `rowspan$a 内容~属性を`反映する$モノトスル。 ◎ The rowSpan IDL attribute must reflect the rowspan content attribute. It is clamped to the range [0, 65534], and its default value is 1.

`headers@m ~IDL属性は、 `headers$a 内容~属性を`反映する$モノトスル。 ◎ The headers IDL attribute must reflect the content attribute of the same name.

`cellIndex@m 取得子~手続きは:

  1. ~IF [ コレの親は `tr$e 要素である ] ⇒ ~RET コレの親の `cells$m ~collectionにおける,コレの~index
  2. ~RET −1
◎ The cellIndex IDL attribute must, if the element has a parent tr element, return the index of the cell's element in the parent element's cells collection. If there is no such parent element, then the attribute must return −1.

`scope@m ~IDL属性は、 `既知な値のみに制限され$る下で, `scope$a 内容~属性を`反映する$モノトスル。 ◎ The scope IDL attribute must reflect the content attribute of the same name, limited to only known values.

`abbr@m ~IDL属性は、 `abbr$a 内容~属性を`反映する$モノトスル。 ◎ The abbr IDL attribute must reflect the content attribute of the same name.

4.9.12. 処理~model

【 以下を簡潔に述べるため、 この訳では次の表記を導入する: 】

  • 整数 %N, %S に対する “{ %N +〜 %S }” という表記は、 %N 以上 ( %N + %S ) 未満の整数~範囲を表す。 特に, %S が 0 以下の場合、 範囲は空になる。
  • 整数~範囲 %X, %Y に対する “ 区画 %X × %Y ” という表記は、[ ~x座標 ~IN %X ]~AND[ ~y座標 ~IN %Y ]なる整数~座標の範囲(すなわち直積~集合)を表すとする。
  • 区画 %X × %Y に対する座標 ( %X の最小~値, %Y の最小~値 ) は、 その区画の~anchorと称される。

種々の~table要素, および それらの内容~属性は、 共に `~table~model@ を定義する: ◎ The various table elements and their content attributes together define the table model.

  • `~table@ は、 二次元の格子に整列された,~cellたちからなる。 この格子は有限であり、 `~slot群@ と称される, 0 個~以上の~slotからなる。 これら各~slotは、 座標 ( %~x, %~y ) を伴う — この座標は、 常に,区画 { 0 +〜 %~x全幅 } × { 0 +〜 %~y全幅 } に入る。 [ %~x全幅, %~y全幅 ]【次節を見よ】のいずれかが 0 になる場合、 当の~tableは空になる(~slotは 0 個)。 各`~table$は、 ある `table$e 要素に対応する。 ◎ A table consists of cells aligned on a two-dimensional grid of slots with coordinates (x, y). The grid is finite, and is either empty or has one or more slots. If the grid has one or more slots, then the x coordinates are always in the range 0 ≤ x < xwidth, and the y coordinates are always in the range 0 ≤ y < yheight. If one or both of xwidth and yheight are zero, then the table is empty (has no slots). Tables correspond to table elements.
  • `~cell@ は、 ある区画 { %~x +〜 %~x幅 } × { %~y +〜 %~y幅 } に入る~slotからなる集合である。 各~cellは、[ ~data~cellと呼ばれる,ある `td$e 要素に対応するもの ]と[ ~header~cellと呼ばれる,ある `th$e 要素に対応するもの ]に分けられる。 いずれにせよ、 各~cellには, 0 個~以上の~header~cellが結付けられる。 ◎ A cell is a set of slots anchored at a slot (cellx, celly), and with a particular width and height such that the cell covers all the slots with coordinates (x, y) where cellx ≤ x < cellx+width and celly ≤ y < celly+height. Cells can either be data cells or header cells. Data cells correspond to td elements, and header cells correspond to th elements. Cells of both types can have zero or more associated header cells.

    ある種の~error事例では、 複数の~cellが同じ~slotを占めることもあり得る。 ◎ It is possible, in certain error cases, for two cells to occupy the same slot.

  • `~row@ は、 特定0の値 %~y に対し,区画 { 0 +〜 %~x全幅 } × { %~y } に入る~slotすべてを占める。 各~rowは通例的に `tr$e 要素に対応する — 複数の~rowに~spanしている`~cell$を孕んでいるような一部の事例では、 `~row~group$の終端には,何本かの暗黙な`~row$が加えられ得るが。 ◎ A row is a complete set of slots from x=0 to x=xwidth-1, for a particular value of y. Rows usually correspond to tr elements, though a row group can have some implied rows at the end in some cases involving cells spanning multiple rows.
  • `~col@ は、 特定0の値 %~x に対し,区画 { %~x } × { 0 +〜 %~y全幅 } に入る~slotすべてを占める。 各~colは、 ある `col$e 要素に対応し得る — 対応する `col$e 要素が無い場合、 暗黙な~colになる。 ◎ A column is a complete set of slots from y=0 to y=yheight-1, for a particular value of x. Columns can correspond to col elements. In the absence of col elements, columns are implied.
  • `~row~group@ は,`~row$たちが成す集合であり、 特定0の %~y, %~y幅 に対し,区画 { 0 +〜 %~x全幅 } × { %~y +〜 %~y幅 } に入る~slotすべてを占める。 各~row~groupは、 ある[ `tbody$e / `thead$e / `tfoot$e ]要素に対応する。 ~rowは、 ~row~groupに属するとは限らない。 ◎ A row group is a set of rows anchored at a slot (0, groupy) with a particular height such that the row group covers all the slots with coordinates (x, y) where 0 ≤ x < xwidth and groupy ≤ y < groupy+height. Row groups correspond to tbody, thead, and tfoot elements. Not every row is necessarily in a row group.
  • `~col~group@ は,`~col$たちが成す集合であり、 特定0の %~x, %~x幅 に対し,区画 { %~x +〜 %~x幅 } × { 0 +〜 %~y全幅 } に入る~slotすべてを占める。 各~col~groupは、 ある `colgroup$e 要素に対応する。 ~colは、 ~col~groupに属するとは限らない。 ◎ A column group is a set of columns anchored at a slot (groupx, 0) with a particular width such that the column group covers all the slots with coordinates (x, y) where groupx ≤ x < groupx+width and 0 ≤ y < yheight. Column groups correspond to colgroup elements. Not every column is necessarily in a column group.

[ `~row~group$どうし / `~col~group$どうし ]が重合することはない。 ◎ Row groups cannot overlap each other. Similarly, column groups cannot overlap each other.

同じ`~cell$が,異なる`~row~group$に属する~slotたちを占めることはない一方で、 複数の`~col~group$に属する~slotたちを占めることはあり得る。 ~slotのうち,ある~cellの一部を形成するものは、[ 0 〜 1 個の`~row~group$の一部を成す / 0 個~以上の`~col~group$の一部を成す ]。 ◎ A cell cannot cover slots that are from two or more row groups. It is, however, possible for a cell to be in multiple column groups. All the slots that form part of one cell are part of zero or one row groups and zero or more column groups.

[ `~cell$, `~col$, `~row$, `~row~group$, `~col~group$ ]に加えて、 `~table$には, `caption$e 要素も結付けられ得る。 これは、 当の~tableに見出しや凡例を与える。 ◎ In addition to cells, columns, rows, row groups, and column groups, tables can have a caption element associated with them. This gives the table a heading, or legend.

`~table~model~error@ とは、 `table$e 要素や その子孫により表現される~dataにおける~errorである。 文書には、 ~table~model~errorがあってはナラナイ。 ◎ A table model error is an error with the data represented by table elements and their descendants. Documents must not have table model errors.

4.9.12.1. ~tableの形成-法

所与の ( `table$e 要素 %~table要素 ) に結付けられる`~table$に対し,[ それを成す どの~slotに どの要素が対応するか, その寸法 ( %~x全幅, %~y全幅 ), `~table~model~error$の有無 ]を決定するときは、 ~UAは,次の~algoを利用するモノトスル: ◎ To determine which elements correspond to which slots in a table associated with a table element, to determine the dimensions of the table (xwidth and yheight), and to determine if there are any table model errors, user agents must use the following algorithm:

  1. ( %~x全幅, %~y全幅 ) ~LET ( 0, 0 )

    【 以下の手続きにおいて作成される各[ ~row/~col ]が占める区画は、[ %~x全幅 / %~y全幅 ]が増やされるに伴い, その幅を占めるよう自動的に伸長すると見なされる。 】

    ◎ Let xwidth be zero. ◎ Let yheight be zero.
  2. %処理待ち~tfoot要素~list ~LET 空~list ◎ Let pending tfoot elements be a list of tfoot elements, initially empty.
  3. %~table ~LET 新たな空な`~table$ ◎ ↓
  4. %~table要素 により表現される`~table$ ~SET %~table ◎ Let the table be the table represented by the table element. The xwidth and yheight variables give the table's dimensions. The table is initially empty.
  5. ~IF[ %~table要素 内に子~要素は無い ] ⇒ ~RET %~table ◎ If the table element has no children elements, then return the table (which will be empty).
  6. ~IF[ %~table要素 の子に `caption$e 要素は在る ] ⇒ それらのうち最初のものを %~table に結付ける — そのような子が無い場合、 結付けられる `caption$e 要素は無い。 ◎ Associate the first caption element child of the table element with the table. If there are no such children, then it has no associated caption element.

  7. %現-要素 ~LET %~table要素 の子である最初の要素 ◎ Let the current element be the first element child of the table element.

    以下において、 `次の要素へ進む@ と記された所では、 次を走らすとする:

    1. ~IF[ %現-要素 に後続する同胞~要素は無い ] ⇒ ~GOTO `終端^i
    2. %現-要素 ~SET %現-要素 の次の同胞~要素
    ◎ If a step in this algorithm ever requires the current element to be advanced to the next child of the table when there is no such next child, then the user agent must jump to the step labeled end, near the end of this algorithm.
  8. ~WHILE 無条件 (この段は、各~col~group/~colを処理する) ◎ ↓

    1. ~WHILE %現-要素 ~NIN { `colgroup$e, `thead$e, `tbody$e, `tfoot$e, `tr$e } ⇒ `次の要素へ進む$ ◎ While the current element is not one of the following elements, advance the current element to the next child of the table: • colgroup • thead • tbody • tfoot • tr
    2. ~IF[ %現-要素 は `colgroup$e でない ] ⇒ ~BREAK ◎ If the current element is a colgroup, follow these substeps: ◎ Column groups: Process the current element according to the appropriate case below:
    3. %元の~x全幅 ~LET %~x全幅 ◎ ↓
    4. ~IF[ %現-要素 の子に `col$e 要素は在る ]: ◎ If the current element has any col element children • Follow these steps:

      1. %現-要素 の子である ~EACH( `col$e 要素 %col ) に対し:

        1. %~span ~LET [[ %col は `~span0$a 属性を有する ]~AND[ その値を`負でない整数として構文解析-$した結果 ~NIN { `失敗^i, 0 } ]ならば `max^op( その結果, 1000 ) / ~ELSE_ 1 ]
        2. %~x全幅 ~INCBY %~span
        3. %col に対応する`~col$たち ~SET %~table 内の最後の %span 本の`~col$
        ◎ Let xstart have the value of xwidth. ◎ Let the current column be the first col element child of the colgroup element. ◎ Columns: If the current column col element has a span attribute, then parse its value using the rules for parsing non-negative integers. ◎ If the result of parsing the value is not an error or zero, then let span be that value. ◎ Otherwise, if the col element has no span attribute, or if trying to parse the attribute's value resulted in an error or zero, then let span be 1. ◎ If span is greater than 1000, let it be 1000 instead. ◎ Increase xwidth by span. ◎ Let the last span columns in the table correspond to the current column col element. ◎ If current column is not the last col element child of the colgroup element, then let the current column be the next col element child of the colgroup element, and return to the step labeled columns. ◎ Let all the last columns in the table from x=xstart to x=xwidth-1 form a new column group, anchored at the slot (xstart, 0), with width xwidth-xstart, corresponding to the colgroup element.
    5. ~ELSE: ◎ If the current element has no col element children

      1. %~x全幅 ~INCBY [ %現-要素 は `span$a 属性を有する ]~AND[ その値を`負でない整数として構文解析-$した結果 ~NIN { `失敗^i, 0 } ]ならば `max^op( その結果, 1000 ) / ~ELSE_ 1 ] ◎ If the colgroup element has a span attribute, then parse its value using the rules for parsing non-negative integers. ◎ If the result of parsing the value is not an error or zero, then let span be that value. ◎ Otherwise, if the colgroup element has no span attribute, or if trying to parse the attribute's value resulted in an error or zero, then let span be 1. ◎ If span is greater than 1000, let it be 1000 instead. ◎ Increase xwidth by span. ◎ Let the last span columns in the table form a new column group, anchored at the slot (xwidth-span, 0), with width span, corresponding to the colgroup element.
    6. %現-要素 に対応する`~col~group$ ~SET %~table 内の最後の[ %~x全幅 − %元の~x全幅 ]本の`~col$が形成する新たな `~col~group$ ◎ ↑
    7. `次の要素へ進む$ ◎ Advance the current element to the next child of the table. ◎ While the current element is not one of the following elements, advance the current element to the next child of the table: • colgroup • thead • tbody • tfoot • tr ◎ If the current element is a colgroup element, jump to the step labeled column groups above.
  9. %現-~y ~LET 0 ◎ Let ycurrent be zero.
  10. %~y方向に延びる~cell群 ~LET 空~list ◎ Let the list of downward-growing cells be an empty list.
  11. ~WHILE 無条件 (この段は、各~row~groupを処理する) ◎ ↓

    1. ~WHILE %現-要素 ~NIN { `thead$e, `tbody$e, `tfoot$e, `tr$e } ⇒ `次の要素へ進む$ ◎ Rows: While the current element is not one of the following elements, advance the current element to the next child of the table: • thead • tbody • tfoot • tr

    2. ~IF[ %現-要素 は `tr$e である ]:

      1. %現-要素 を成す`~rowを処理する$
      2. `次の要素へ進む$
      3. ~CONTINUE
      ◎ If the current element is a tr, then run the algorithm for processing rows, advance the current element to the next child of the table, and return to the step labeled rows.
    3. `~row~groupを終端する$ ◎ Run the algorithm for ending a row group.
    4. ~IF[ %現-要素 は `tfoot$e である ]:

      1. %現-要素 を %処理待ち~tfoot要素~list に追加する
      2. `次の要素へ進む$
      3. ~CONTINUE
      ◎ If the current element is a tfoot, then add that element to the list of pending tfoot elements, advance the current element to the next child of the table, and return to the step labeled rows.
    5. %現-要素 を成す`~row~groupを処理する$ ◎ The current element is either a thead or a tbody. ◎ Run the algorithm for processing row groups.
    6. `次の要素へ進む$ ◎ Advance the current element to the next child of the table. ◎ Return to the step labeled rows.
  12. `終端^i:
    %処理待ち~tfoot要素~list を成す ~EACH( `tfoot$e 要素 %要素 ) に対し,`~tree順序$で ⇒ %要素 を成す`~row~groupを処理する$ ◎ End: For each tfoot element in the list of pending tfoot elements, in tree order, run the algorithm for processing row groups.
  13. %~table 内の ある[ `~row$ / `~col$ ]に対し,その区画~内の~slotを~anchorとしている`~cell$は無い場合、 `~table~model~error$とする ◎ If there exists a row or column in the table containing only slots that do not have a cell anchored to them, then this is a table model error.
  14. ~RET %~table ◎ Return the table.

上の手続きにて[ `thead$e / `tbody$e / `tfoot$e ]要素 %要素 を成す `~row~groupを処理する@ ときは、 次を走らす: ◎ The algorithm for processing row groups, which is invoked by the set of steps above for processing thead, tbody, and tfoot elements, is:

  1. %元の~y全幅 ~LET %~y全幅 の値 ◎ Let ystart have the value of yheight.
  2. %要素 の子である ~EACH( `tr$e 要素 %tr ) に対し,~tree順序で ⇒ %tr を成す`~rowを処理する$ ◎ For each tr element that is a child of the element being processed, in tree order, run the algorithm for processing rows.
  3. ~IF[ %~y全幅 ~GT %元の~y全幅 ] ⇒ %要素 に対応する`~row~group$ ~SET %~table 内の最後の[ %~y全幅 ~MINUS %元の~y全幅 ]本の`~row$で形成される新たな`~row~group$ ◎ If yheight > ystart, then let all the last rows in the table from y=ystart to y=yheight-1 form a new row group, anchored at the slot with coordinate (0, ystart), with height yheight-ystart, corresponding to the element being processed.
  4. `~row~groupを終端する$ ◎ Run the algorithm for ending a row group.

上のいずれかの手続きにて,~rowたちが成す~blockの[ 開始-時/終端-時 ]に `~row~groupを終端する@ ときは、 次を走らす: ◎ The algorithm for ending a row group, which is invoked by the set of steps above when starting and ending a block of rows, is:

  1. %~y方向に延びる~cell群 を成す ~EACH( `~cell$ %~cell ) に対し ⇒ %~cell の区画を,その~x座標の範囲はそのままに,[ ~y座標の範囲が ( %~y全幅 − 1 ) をちょうど含む ]まで拡張する ◎ While ycurrent is less than yheight, follow these steps: • Run the algorithm for growing downward-growing cells. • Increase ycurrent by 1.
  2. %~y方向に延びる~cell群 を空にする ◎ Empty the list of downward-growing cells.
  3. %現-~y ~SET %~y全幅 ◎ ↑

上のいずれかの手続きにて `tr$e 要素 %tr を成す `~rowを処理する@ ときは、 次を走らす: ◎ The algorithm for processing rows, which is invoked by the set of steps above for processing tr elements, is:

  1. %~y全幅 ~SET `max^op( %~y全幅, %現-~y ~PLUS 1 ) ◎ If yheight is equal to ycurrent, then increase yheight by 1. (ycurrent is never greater than yheight.)
  2. %~y方向に延びる~cell群 を成す ~EACH( `~cell$ %~cell ) に対し ⇒ %~cell の区画を,その~x座標の範囲はそのままに,[ ~y座標の範囲が ( %~y全幅 − 1 ) をちょうど含む ]まで拡張する ◎ ↓
  3. %現-~x ~LET 0 ◎ Let xcurrent be 0. ◎ Run the algorithm for growing downward-growing cells.
  4. %tr の子である ~EACH([ `td$e / `th$e ]要素 %~cell要素 ) に対し,~tree順序で: ◎ If the tr element being processed has no td or th element children, then increase ycurrent by 1, abort this set of steps, and return to the algorithm above. ◎ Let current cell be the first td or th element child in the tr element being processed.

    1. ~WHILE[ %現-~x ~LT %~x全幅 ]~AND[ ~slot ( %現-~x, %現-~y ) を占めている~cellがすでにある ] ⇒ %現-~x ~INCBY 1 ◎ Cells: While xcurrent is less than xwidth and the slot with coordinate (xcurrent, ycurrent) already has a cell assigned to it, increase xcurrent by 1.
    2. %~x全幅 ~SET `max^op( %~x全幅, %現-~x ) ◎ If xcurrent is equal to xwidth, increase xwidth by 1. (xcurrent is never greater than xwidth.)
    3. ( %~x幅, %~y幅 ) ~LET ( 1, 1 ) ◎ ↓
    4. ~IF[ %~cell要素 は `colspan$a 属性を有する ]~AND[ その値を`負でない整数として構文解析-$した結果 ~NIN { `失敗^i, 0 } ] ⇒ %~x幅 ~SET `max^op( その結果, 1000 ) ◎ If the current cell has a colspan attribute, then parse that attribute's value, and let colspan be the result. ◎ If parsing that value failed, or returned zero, or if the attribute is absent, then let colspan be 1, instead. ◎ If colspan is greater than 1000, let it be 1000 instead.
    5. ~IF[ %~cell要素 は `rowspan$a 属性を有する ]~AND[ その値を`負でない整数として構文解析-$した結果 ~NEQ `失敗^i ] ⇒ %~y幅 ~SET `max^op( その結果, 65534 ) ◎ If the current cell has a rowspan attribute, then parse that attribute's value, and let rowspan be the result. ◎ If parsing that value failed or if the attribute is absent, then let rowspan be 1, instead. ◎ If rowspan is greater than 65534, let it be 65534 instead.
    6. %~cellは~y方向に延びるか ~LET ~F ◎ ↓
    7. ~IF[ %~y幅 ~EQ 0 ]:

      1. ~IF[ %~table要素 の`~node文書$は`過去互換~mode$でない ] ⇒ %~cellは~y方向に延びるか ~SET ~T
      2. %~y幅 ~SET 1

      【 原文のこの段の記述は,[ 過去互換~modeである場合には,何もせず %~y幅 は 0 のままにされる ]ように読めるが、 そうすると以下で空な区画を占める~cellを作成することになり,おかしいので, 修正している。 】

      ◎ If rowspan is zero and the table element's node document is not set to quirks mode, then let cell grows downward be true, and set rowspan to 1. Otherwise, let cell grows downward be false.
    8. %~x全幅 ~SET `max^op( %~x全幅, %現-~x ~PLUS %~x幅 ) ◎ If xwidth < xcurrent+colspan, then let xwidth be xcurrent+colspan.
    9. %~y全幅 ~SET `max^op( %~y全幅, %現-~y ~PLUS %~y幅 ) ◎ If yheight < ycurrent+rowspan, then let yheight be ycurrent+rowspan.
    10. %新~cell ~LET 次のようにされた新たな`~cell$

      • 区画 { %現-~x +〜 %~x幅 } × { %現-~y +〜 %~y幅 } を占める
      • %~cell要素 に応じて ⇒# `th$e 要素であるならば ~header~cellとする / `td$e 要素であるならば ~data~cellとする
      ◎ Let the slots with coordinates (x, y) such that xcurrent ≤ x < xcurrent+colspan and ycurrent ≤ y < ycurrent+rowspan be covered by a new cell c, anchored at (xcurrent, ycurrent), which has width colspan and height rowspan, corresponding to the current cell element. ◎ If the current cell element is a th element, let this new cell c be a header cell; otherwise, let it be a data cell.
    11. %~cell要素 に対応する`~cell$ ~SET %新~cell:

      • %~cell要素 に どの~header~cellたちが適用されるかを確立するためには、 次~節に述べる`~header~cellたちをアテガう$~algoを利用すること。
      • %新~cell が占める区画~内に,すでに他のある`~cell$が占めている~slotがある場合、 `~table~model~error$とされる — そのような~slotには複数の~cellが重合している。
      ◎ To establish which header cells apply to the current cell element, use the algorithm for assigning header cells described in the next section. ◎ If any of the slots involved already had a cell covering them, then this is a table model error. Those slots now have two cells overlapping.
    12. ~IF[ %~cellは~y方向に延びるか ~EQ ~T ] ⇒ %新~cell を %~y方向に延びる~cell群 に追加する ◎ If cell grows downward is true, then add the tuple {c, xcurrent, colspan} to the list of downward-growing cells.
    13. %現-~x ~INCBY %~x幅 ◎ Increase xcurrent by colspan.
  5. %現-~y ~INCBY 1 ◎ If current cell is the last td or th element child in the tr element being processed, then increase ycurrent by 1, abort this set of steps, and return to the algorithm above. ◎ Let current cell be the next td or th element child in the tr element being processed. ◎ Return to the step labeled cells. ◎ When the algorithms above require the user agent to run the algorithm for growing downward-growing cells, the user agent must, for each {cell, cellx, width} tuple in the list of downward-growing cells, if any, extend the cell cell so that it also covers the slots with coordinates (x, ycurrent), where cellx ≤ x < cellx+width.
4.9.12.2. ~data~cellたちと~header~cellたちとの関係性の形成-法

各 ~cellには 0 個~以上の~header~cellがアテガわれる — それは、 次の `~header~cellたちをアテガう@ ~algoの結果で与えられる: ◎ Each cell can be assigned zero or more header cells. The algorithm for assigning header cells to a cell principal cell is as follows.

  1. %首要~cell ~SET 当の~cell ◎ ↑
  2. %~header~list ~LET ~cellたちの空~list ◎ Let header list be an empty list of cells. ◎ Let (principalx, principaly) be the coordinate of the slot to which the principal cell is anchored.
  3. ~IF[ %首要~cell は `headers$a 属性を有する ]: ◎ If the principal cell has a headers attribute specified

    1. %~token群 ~LET `~ASCII空白で分割する$( %首要~cell の `headers$a 属性の値 ) ◎ Take the value of the principal cell's headers attribute and split it on ASCII whitespace, letting id list be the list of tokens obtained.
    2. %~token群 を成す ~EACH( %~token ) に対し:

      1. %要素 ~LET 次を満たす要素は[ 在るならば それらのうち最初のもの/ 無いならば ε ] ⇒ [ 当の`~table$と同じ`文書$内にある ]~AND[ `~ID$ ~EQ %~token ]
      2. ~IF[ %要素 ~NEQ ε ]~AND[ 当の`~table$内に %要素 に対応する~cellは在る 【!かつ %首要~cell でない:後で除去するので不要】 ] ⇒ %~header~list に該当する~cellを追加する
      ◎ For each token in the id list, if the first element in the Document with an ID equal to the token is a cell in the same table, and that cell is not the principal cell, then add that cell to header list.
  4. ~ELSE: ◎ If principal cell does not have a headers attribute specified

    1. ( %首要~anchor, %首要~区画 ) ~LET %首要~cell の ( ~anchor, 区画 ) ◎ Let principalwidth be the width of the principal cell. ◎ Let principalheight be the height of the principal cell.
    2. %首要~区画 の~y座標の範囲~内の ~EACH( %~y ) に対し,昇順に ⇒ 次を与える下で `内部的に~header~cellを走査してアテガう$ ⇒ ( %首要~cell, %~header~list , 座標 ( %首要~anchor の~x座標, %~y ), `~row方向^i ) ◎ For each value of y from principaly to principaly+principalheight-1, run the internal algorithm for scanning and assigning header cells, with the principal cell, the header list, the initial coordinate (principalx,y), and the increments Δx=−1 and Δy=0.
    3. %首要~区画 の~x座標の範囲~内の ~EACH( %~x ) に対し,昇順に ⇒ 次を与える下で `内部的に~header~cellを走査してアテガう$ ⇒ ( %首要~cell, %~header~list, 座標 ( %~x, %首要~anchor の~y座標 ), `~col方向^i ) ◎ For each value of x from principalx to principalx+principalwidth-1, run the internal algorithm for scanning and assigning header cells, with the principal cell, the header list, the initial coordinate (x,principaly), and the increments Δx=0 and Δy=−1.
    4. %区画 ~LET 区画 { 0 〜 %首要~区画 の最~大な~x座標 } × { 0 〜 %首要~区画 の最~大な~y座標 } ◎ ↓
    5. ~IF[ %首要~anchor ~IN ある`~row~group$の区画 %A ] ⇒ %~header~list に[ 次を満たす すべての~header~cell ]を追加する ⇒ [ `~row~group~header$である ]~AND[ その~anchor ~IN %A ]~AND[ その~anchor ~IN %区画 ] ◎ If the principal cell is anchored in a row group, then add all header cells that are row group headers and are anchored in the same row group with an x-coordinate less than or equal to principalx+principalwidth-1 and a y-coordinate less than or equal to principaly+principalheight-1 to header list.
    6. ~IF[ %首要~anchor ~IN ある`~col~group$ の区画 %A ] ⇒ %~header~list に[ 次を満たす すべての~header~cell ]を追加する ⇒ [ `~col~group~header$である ]~AND[ その~anchor ~IN %A ]~AND[ その~anchor ~IN %区画 ] ◎ If the principal cell is anchored in a column group, then add all header cells that are column group headers and are anchored in the same column group with an x-coordinate less than or equal to principalx+principalwidth-1 and a y-coordinate less than or equal to principaly+principalheight-1 to header list.
  5. %~header~list から[ すべての`空な~cell$, および %首要~cell ]を除去する(もし在れば) ◎ Remove all the empty cells from the header list.
  6. %~header~list 内に重複する~cellが在るならば,一つを残して他を除去する ◎ Remove any duplicates from the header list. ◎ Remove principal cell from the header list if it is there.
  7. ~RET %~header~list ◎ Assign the headers in the header list to the principal cell.

`内部的に~header~cellを走査してアテガう@ ときは、 所与の ( %首要~cell, %~header~list, 座標 ( %~x, %~y ), %方向 ) に対し,次を走らす: ◎ The internal algorithm for scanning and assigning header cells, given a principal cell, a header list, an initial coordinate (initialx, initialy), and Δx and Δy increments, is as follows:

  1. %行止まり~header群 ~LET 空~集合 (一群の~cellからなる) ◎ Let x equal initialx. ◎ Let y equal initialy. ◎ Let opaque headers be an empty list of cells.
  2. %~header~block内か ~LET ~F ◎ ↓
  3. %現-~header~blockに属する~header群 ~LET 空~集合 (一群の~cellからなる) ◎ ↓
  4. ~IF[ %首要~cell は~header~cellである ]:

    1. %~header~block内か ~SET ~T
    2. %首要~cell を %現-~header~blockに属する~header群 に追加する
    ◎ If principal cell is a header cell • Let in header block be true, and let headers from current header block be a list of cells containing just the principal cell. ◎ Otherwise • Let in header block be false and let headers from current header block be an empty list of cells.
  5. %~slot~list ~LET %方向 に応じて:

    • `~row方向^i ⇒ 区画 { 0 +〜 %~x } × { %~y } 内の~slotたちからなる~x座標の降順による~list
    • `~col方向^i ⇒ 区画 { %~x } × { 0 +〜 %~y } 内の~slotたちからなる~y座標の降順による~list

    ([ %~x ~EQ 0 / %~y ~EQ 0 ]ならば空になる。)

    ◎ Loop: Increment x by Δx; increment y by Δy. ◎ For each invocation of this algorithm, one of Δx and Δy will be −1, and the other will be 0.
  6. %~slot~list を成す ~EACH( %~slot ) に対し: ◎ If either x or y are less than 0, then abort this internal algorithm.

    1. ~IF[ %~slot を占めている~cellの個数 ~NEQ 1 ] ⇒ ~CONTINUE ◎ If there is no cell covering slot (x, y), or if there is more than one cell covering slot (x, y), return to the substep labeled loop.
    2. %現-~cell ~LET %~slot を占めている~cell ◎ Let current cell be the cell covering slot (x, y).
    3. ~IF[ %現-~cell は~header~cellである ]: ◎ If current cell is a header cell

      1. %~header~block内か ~SET ~T ◎ Set in header block to true.
      2. %現-~cell を %現-~header~blockに属する~header群 に追加する ◎ Add current cell to headers from current header block.
      3. %方向 に応じて: ◎ Let blocked be false.

        • `~col方向^i ⇒ ~IF[ %現-~cell は`~col~header$でない ]~OR[ %行止まり~header群 内にある~cellがあって,その区画の~x座標の範囲と %現-~cell のそれは一致する ] ⇒ ~CONTINUE ◎ If Δx is 0 • If there are any cells in the opaque headers list anchored with the same x-coordinate as the current cell, and with the same width as current cell, then let blocked be true. • If the current cell is not a column header, then let blocked be true.
        • `~row方向^i ⇒ ~IF[ %現-~cell は`~row~header$でない ]~OR[ %行止まり~header群 内にある~cellがあって,その区画の~y座標の範囲と %現-~cell のそれは一致する ] ⇒ ~CONTINUE ◎ If Δy is 0 • If there are any cells in the opaque headers list anchored with the same y-coordinate as the current cell, and with the same height as current cell, then let blocked be true. • If the current cell is not a row header, then let blocked be true.
      4. %現-~cell を %~header~list に追加する ◎ If blocked is false, then add the current cell to the headers list.
    4. ~ELSE( %現-~cell は~data~cellである): ◎ If current cell is a data cell\

      1. ~IF[ %~header~block内か ~EQ ~F ] ⇒ ~CONTINUE ◎ and in header block is true
      2. %~header~block内か ~SET ~F ◎ Set in header block to false.\
      3. %行止まり~header群 に %現-~header~blockに属する~header群 を成すすべての~cellを追加する ◎ Add all the cells in headers from current header block to the opaque headers list, and\
      4. %現-~header~blockに属する~header群 を空にする ◎ empty the headers from current header block list. ◎ Return to the step labeled loop.

~header~cell %~cell は、 対応する要素の `scope$a 属性の状態を %状態 とするとき: ◎ ↓

  • ~OR↓ を満たすならば `~col~header@ とされる: ◎ A header cell anchored at the slot with coordinate (x, y) with width width and height height is said to be a column header if any of the following are true:

    • %状態 ~EQ `Column$st ◎ the cell's scope attribute is in the column state; or
    • [ %状態 ~EQ `Auto$st ]~AND[ どの~data~cellも[ ~y座標 ~IN %~cell が占める区画の~y座標の範囲† ]なる~slotを占めていない ] ◎ the cell's scope attribute is in the auto state, and there are no data cells in any of the cells covering slots with y-coordinates y .. y+height-1.

    【† 不可解な条件。 おそらく、[ 座標 ~IN 区画 { %~cell が占める区画の~x座標の範囲 } × { 0 +〜 %~cell の~anchorの~y座標 } ]に改められるべきに思われる。 次項についても同様。 】

  • ~OR↓ を満たすならば `~row~header@ とされる: ◎ A header cell anchored at the slot with coordinate (x, y) with width width and height height is said to be a row header if any of the following are true:

    • %状態 ~EQ `Row$st ◎ the cell's scope attribute is in the row state; or
    • [ %状態 ~EQ `Auto$st ]~AND[ %~cell は`~col~header$でない ]~AND[ どの~data~cellも[ ~x座標 ~IN %~cell が占める区画の~x座標の範囲† ]なる~slotを占めていない ] ◎ the cell's scope attribute is in the auto state, the cell is not a column header, and there are no data cells in any of the cells covering slots with x-coordinates x .. x+width-1.
  • 次を満たすならば `~col~group~header@ とされる ⇒ %状態 ~EQ `Colgroup$st ◎ A header cell is said to be a column group header if its scope attribute is in the column group state.
  • 次を満たすならば `~row~group~header@ とされる ⇒ %状態 ~EQ `Rowgroup$st ◎ A header cell is said to be a row group header if its scope attribute is in the row group state.

~cellは、 対応する要素が次を満たすならば `空な~cell@ とされる ⇒ [ 包含している要素は無い ]~AND[ `子~text内容$は`~ASCII空白$以外を含まない ] ◎ A cell is said to be an empty cell if it contains no elements and its child text content, if any, consists only of ASCII whitespace.

4.9.13. 例

◎非規範的

【 この節は未訳。 】