Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Data Elements

Table

A static table. rows is a sequence of rows, and the first cell of each row is rendered as a row header (<th scope="row">).

sc.Table(
    rows=[
        ('Alice', 'Engineering', 'alice@example.com'),
        ('Bob', 'Design', 'bob@example.com'),
    ],
    header=('Name', 'Team', 'Email'),
    caption='Team directory',
    footer='3 people',
)
ArgumentTypeMeaning
rowssequence of sequencesBody rows
headersequence of stringsOptional header row
captionstrCaption above the table
footerstrFooter below the table
header_backgroundboolDraw a background behind the header
titlestrOptional table title
visiblebool | Property | 'auto'Default 'auto'

Properties: rows.

The table is static in the DOM: to update it, set a new rows value. The row header cell is useful for a matrix-like table where the first column labels the row.

Markdown color markers such as :red[overdue] work inside cells.

An empty rows value hides the table when visible='auto'.