用于呈现数据的语义表格元素。
¥API Reference
¥Root
Header
和 Body
部分分组。此组件基于 table
元素并支持 常用边距属性。
¥Groups the Header
and Body
parts. This component is based on the table
element and supports common margin props.
¥Header
包含基于 thead
元素的表格列标题。
¥Contains the column headings for the table, based on the thead
element.
¥Body
显示表格数据。此组件基于 tbody
元素。
¥Displays the table data. This component is based on the tbody
element.
¥Row
一行表格单元格。基于 tr
元素。
¥A row of table cells. Based on the tr
element.
¥Cell
一个基本表格单元格。此组件基于 td
元素,但使用 justify
而不是 align
来控制表格单元格内水平空间的分布方式。
¥A basic table cell. This component is based on the td
element, but uses justify
instead of align
to control how horizontal space is distributed within the table cell.
表格列的标题。基于 th
元素,并提供与 Cell
部分相同的 props 接口。
¥The header of a table column. Based on the th
element and provides the same props interface as the Cell
part.
表格行的标题。基于 th
元素,并提供与 Cell
部分相同的 props 接口。
¥The header of a table row. Based on the th
element and provides the same props interface as the Cell
part.
¥Examples
¥Size
使用 size
属性控制表格单元格的文本和内边距的大小。
¥Use the size
prop to control how large the text and padding of the table cells should be.
¥With a backplate
使用 variant="surface"
为表格添加视觉上封闭的背板。
¥Use variant="surface"
to add a visually enclosed backplate to the table.