Skip to main content

Table

cds-table

The table component is designed to style basic HTML tables, applying global design styles consistently across your project. Use this component to easily integrate table styling into your application with minimal effort.

Default

NameAgeRoleLocation
John Doe28DeveloperNew York
Jane Smith34UX DesignerLos Angeles
Sam Green38Product OwnerChicago
Total: 3 rows
<table class="cds-table">
<thead>
<tr>...</tr>
</thead>
<tbody>
<tr>...</tr>
<tr>...</tr>
<tr>...</tr>
</tbody>
<tfoot>
<tr>...</tr>
</tfoot>
</table>

Elements

ElementCodeParentRequired
thead<thead>HTML Element: <table>optional
tbody<tbody>HTML Element: <table>required
tfoot<tfoot>HTML Element: <table>optional
John Doe28DeveloperNew York
Jane Smith34UX DesignerLos Angeles
Sam Green38Product OwnerChicago

Modifiers

ModifierOptions
Alternate--alternate
NameAgeRoleLocation
John Doe28DeveloperNew York
Jane Smith34UX DesignerLos Angeles
Sam Green38Product OwnerChicago
Alice Brown30WriterSan Francisco
Michael White45Product ManagerBoston
Total: 5 rows
<table class="cds-table cds-table--alternate">
<thead>...</thead>
<tbody>...</tbody>
<tfoot>...</tfoot>
</table>

States

ModifierOptions
Statesis-disabled, is-loading, is-selected

Is disabled

NameAgeRoleLocation
John Doe28DeveloperNew York
Jane Smith34UX DesignerLos Angeles
Disabled row39UX DesignerBarcelona
Sam Green38Product OwnerChicago
Total: 3 rows
Example
...
<tr class="is-disabled">
...

Is loading

NameAgeRoleLocation
John Doe28DeveloperNew York
Jane Smith34UX DesignerLos Angeles
Loading row39UX DesignerBarcelona
Sam Green38Product OwnerChicago
Total: 3 rows
Example
...
<tr class="is-loading">
...

Is selected

NameAgeRoleLocation
John Doe28DeveloperNew York
Jane Smith34UX DesignerLos Angeles
Selected row39UX DesignerBarcelona
Sam Green38Product OwnerChicago
Total: 3 rows
Example
...
<tr class="is-selected">
...