<<PREV | TOP | NEXT>>

セル要素; TH, TD 要素

last modified 23rd/Oct. 2000

の各セルは、 TH 要素と TD 要素で表わします。データが入ったセルを TD 要素であらわし、 その見しが入ったセルは TH 要素で表わします。セルは何れかの行に属し、 TH, TD 要素は TR 要素の子供要素としてしか現れない事に注意してください。

セル要素の要素宣言;

<!ELEMENT (TH|TD)  - O (%flow;)*       -- table header cell, table data cell-->

セル要素の属性宣言;

<!-- TH is for headers, TD for data, but for cells acting as both use TD -->
<!ATTLIST (TH|TD)                      -- header or data cell --
  %attrs;                              -- %coreattrs, %i18n, %events --
  abbr        %Text;         #IMPLIED  -- abbreviation for header cell --
  axis        CDATA          #IMPLIED  -- comma-separated list of related headers--
  headers     IDREFS         #IMPLIED  -- list of id's for header cells --
  scope       %Scope;        #IMPLIED  -- scope covered by header cells --
  rowspan     NUMBER         1         -- number of rows spanned by cell --
  colspan     NUMBER         1         -- number of cols spanned by cell --
  %cellhalign;                         -- horizontal alignment in cells --
  %cellvalign;                         -- vertical alignment in cells --
  nowrap      (nowrap)       #IMPLIED  -- suppress word wrap --
  bgcolor     %Color;        #IMPLIED  -- cell background color --
  width       %Length;       #IMPLIED  -- width for cell --
  height      %Length;       #IMPLIED  -- height for cell --
  >

属性定義

headers = idrefs [CS]
scope = scope-name [CI]
abbr = text [CS]
axis = cdata [CI]
rowspan = number [CN]
colspan = number [CN]
nowrap [CI]
width = length [CN]
height = length [CN]

表の具体例;

<table border="4"
   summary="表関連要素のまとめ。第ゼロ列から順番に、要素名、
   開始タグの省略可能性、終了タグの省略可能性、意味、内容モデル。">
<caption>表関連要素のまとめ</caption>
<colgroup>
  <col width="100" align="center">
  <col span="2" width="80" align="center">
  <col width="160">
  <col align="center">
</colgroup>
<thead>
  <tr>
    <th scope="row">要素名</th>
    <th scope="row">開始タグ</th><th scope="row">終了タグ</th>
    <th scope="row">意味</th><th scope="row">内容モデル</th>
  </tr>
</thead>
<tfoot>
  <tr>
    <th scope="row">要素名</th>
    <th scope="row">開始タグ</th><th scope="row">終了タグ</th>
    <th scope="row">意味</th><th scope="row">内容モデル</th>
  </tr>
</tfoot>
<tbody>
  <tr>
    <th scope="col">table</th>
    <td>必須</td><td>省略可能</td>
    <td>表要素</td><td>CAPTION, COL, COLGROUP, THEAD, TFOOT, TBODY</td>
  </tr>
</tbody>
<tbody>
  <tr>
    <th scope="col">caption</th>
    <td>必須</td><td>必須</td>
    <td>表題要素</td><td>インライン要素</td>
  </tr>
</tbody>
<tbody>
  <tr>
    <th scope="col">colgroup</th>
    <td>必須</td><td>省略可能</td>
    <td>列グループ要素</td><td>COL</td>
  </tr>
  <tr>
    <th scope="col">col</th>
    <td>必須</td><td>無し</td>
    <td>列属性共有化要素</td><td>空要素 (Empty)</td>
  </tr>
</tbody>
</table>

表示サンプル;

表関連要素のまとめ
要素名 開始タグ終了タグ 意味内容モデル
要素名 開始タグ終了タグ 意味内容モデル
table 必須省略可能 表要素CAPTION, COL, COLGROUP, THEAD, TFOOT, TBODY
caption 必須必須 表題要素インライン要素
colgroup 必須省略可能 列グループ要素COL
col 必須無し 列属性共有化要素空要素 (Empty)
tbody省略可能省略可能 行内容グループ要素TR
thead必須省略可能 行ヘッダグループ要素
tfoot必須省略可能 行フッタグループ要素
tr必須省略可能 行要素TH, TD
th必須省略可能 見出しセル要素任意 (%flow;)
td必須省略可能 データセル要素任意 (%flow;)

内容モデルとは、当該要素の子供要素になり得る要素のことです。

<<PREV | TOP | NEXT>>

FC2> モビット