mur*_*uga 11

表行可以分别使用THEAD,TFOOT和TBODY元素分组为表头,表脚和一个或多个表体部分.这种划分使用户代理能够独立于桌面和桌脚支持滚动桌面.当打印长表时,可以在包含表数据的每个页面上重复表头和脚信息.

表头和表脚应包含有关表列的信息.表体应包含表数据行.

如果存在,每个THEAD,TFOOT和TBODY都包含一个行组.每个行组必须至少包含一行,由TR元素定义.

资料来源:http://www.w3.org/TR/html401/struct/tables.html#h-11.2.3

  • 需要强调一点:一个表可以有 **多个“tbody”元素**。使用它们进行分组。另请参阅“td”和“th”的“scope”属性 - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope (2认同)

Gum*_*mbo 5

不,没有这样的元素.如果要对行进行分组,可以将特定tr元素放在同一个类中.


所述"rowgroup"你指的是自然由元件等形成的行组thead,tbodytfoot.和范围是用来定义在相同的命名中设置的值的属性scope被用于指代在当前的范围th元件被用于提供信息:

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

<!-- Scope is simpler than headers attribute for common tables -->
<!ENTITY % Scope "(row|col|rowgroup|colgroup)">

<!-- 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 --
  >
Run Code Online (Sandbox Code Playgroud)

这里Scope是一个带有值的参数实体(row|col|rowgroup|colgroup).然后scope,在参数实体引用 的属性值列表的声明中引用实体%Scope;.

SGML中的参数实体类似于变量,对这些参数实体的引用被其值替换.这意味着以下两个属性定义是相同的:

<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
<!ATTLIST (FOOBAR)
  scope       %Scope;        #IMPLIED
>

<!ATTLIST (FOOBAR)
  scope       (row|col|rowgroup|colgroup)        #IMPLIED
>
Run Code Online (Sandbox Code Playgroud)