Skip to content

Table

The Table component wraps Bulma’s table element in a scrollable container, with optional column headers and title.

NameRoleStatus
AliceAdminActive
BobMemberActive
CarolMemberInactive
<Table columns={["Name", "Role", "Status"]}>
<tbody>
<tr><td>Alice</td><td>Admin</td><td>Active</td></tr>
<tr><td>Bob</td><td>Member</td><td>Active</td></tr>
<tr><td>Carol</td><td>Member</td><td>Inactive</td></tr>
</tbody>
</Table>

Team Members

NameRole
AliceAdmin
BobMember
<Table title="Team Members" columns={["Name", "Role"]}>
<tbody>
<tr><td>Alice</td><td>Admin</td></tr>
<tr><td>Bob</td><td>Member</td></tr>
</tbody>
</Table>

Columns can be objects with label and style properties to set column widths or alignment:

NameScore
Alice98
Bob84
<Table
columns={[
{ label: "Name", style: "width: 60%" },
{ label: "Score", style: "text-align: right" },
]}
>
<tbody>
<tr><td>Alice</td><td style="text-align: right">98</td></tr>
<tr><td>Bob</td><td style="text-align: right">84</td></tr>
</tbody>
</Table>
FruitCount
Apple12
Banana5
<Table>
<thead>
<tr><th>Fruit</th><th>Count</th></tr>
</thead>
<tbody>
<tr><td>Apple</td><td>12</td></tr>
<tr><td>Banana</td><td>5</td></tr>
</tbody>
</Table>
PropTypeDefaultDescription
titlestringHeading rendered above the table.
columns(string | { label: string; style?: string } | null | undefined | false)[]Column header definitions. Falsy values are filtered out.
classNamestringExtra CSS classes on the <table> element.