<display-internal>

一些布局模型(例如 tableruby)具有复杂的内部结构,其子元素和后代元素可以扮演多种不同的角色。本页定义了这些“内部”的 display 值,它们仅在该特定布局模式下有意义。

语法

有效的 <display-internal>

table-row-group

这些元素的行为类似于 <tbody> HTML 元素。

table-header-group

这些元素的行为类似于 <thead> HTML 元素。

这些元素的行为类似于 <tfoot> HTML 元素。

table-row

这些元素的行为类似于 <tr> HTML 元素。

table-cell

这些元素的行为类似于 <td> HTML 元素。

table-column-group

这些元素的行为类似于 <colgroup> HTML 元素。

table-column

这些元素的行为类似于 <col> HTML 元素。

table-caption

这些元素的行为类似于 <caption> HTML 元素。

ruby-base

这些元素的行为类似于 <rb> HTML 元素。

ruby-text

这些元素的行为类似于 <rt> HTML 元素。

ruby-base-container

这些元素被生成为匿名盒子。

ruby-text-container

这些元素的行为类似于 <rtc> HTML 元素。

正式语法

<display-internal> = 
table-row-group |
table-header-group |
table-footer-group |
table-row |
table-cell |
table-column-group |
table-column |
table-caption |
ruby-base |
ruby-text |
ruby-base-container |
ruby-text-container

示例

CSS 表格示例

以下示例演示了使用 CSS 表格布局排列表单。

HTML

html
<main>
  <div>
    <label for="name">Name</label>
    <input type="text" id="name" name="name" />
  </div>
  <div>
    <label for="age">Age</label>
    <input type="text" id="age" name="age" />
  </div>
</main>

CSS

css
main {
  display: table;
}

div {
  display: table-row;
}

label,
input {
  display: table-cell;
  margin: 5px;
}

结果

规范

此特性似乎未在任何规范中定义。

浏览器兼容性

css.properties.display.table-row-group

css.properties.display.table-header-group

css.properties.display.table-row

css.properties.display.table-cell

css.properties.display.table-column-group

css.properties.display.table-column

css.properties.display.table-caption

css.properties.display.ruby-base

css.properties.display.ruby-text

css.properties.display.ruby-base-container

css.properties.display.ruby-text-container

另见