Table

A table of data: the native table elements, in the look of the app's style. For sorting, filtering, selection and pages, use a Data Table.

Data DisplayExperimental

Usage

import { Component, ViewEncapsulation } from '@angular/core';import {  ScTable,  ScTableBody,  ScTableCaption,  ScTableCell,  ScTableContainer,  ScTableHeader,  ScTableHeaderCell,  ScTableRow,} from '@semantic-components/ui';
@Component({  selector: 'app-table-usage-demo',  imports: [    ScTable,    ScTableBody,    ScTableCaption,    ScTableCell,    ScTableContainer,    ScTableHeader,    ScTableHeaderCell,    ScTableRow,  ],  template: `    <div scTableContainer>      <table scTable>        <caption scTableCaption>          A list of your recent invoices.        </caption>        <thead scTableHeader>          <tr scTableRow>            <th scTableHeaderCell class="w-24">Invoice</th>            <th scTableHeaderCell>Status</th>            <th scTableHeaderCell>Method</th>            <th scTableHeaderCell class="text-end">Amount</th>          </tr>        </thead>        <tbody scTableBody>          @for (invoice of invoices; track invoice.id) {            <tr scTableRow>              <td scTableCell class="font-medium">{{ invoice.id }}</td>              <td scTableCell>{{ invoice.status }}</td>              <td scTableCell>{{ invoice.method }}</td>              <td scTableCell class="text-end">{{ invoice.amount }}</td>            </tr>          }        </tbody>      </table>    </div>  `,  host: { class: 'block w-full' },  encapsulation: ViewEncapsulation.None,})export class TableUsageDemo {  private readonly invoices = [    { id: 'INV001', status: 'Paid', method: 'Credit Card', amount: '$250.00' },    { id: 'INV002', status: 'Pending', method: 'PayPal', amount: '$150.00' },    {      id: 'INV003',      status: 'Unpaid',      method: 'Bank Transfer',      amount: '$350.00',    },    { id: 'INV004', status: 'Paid', method: 'Credit Card', amount: '$450.00' },    { id: 'INV005', status: 'Paid', method: 'PayPal', amount: '$550.00' },    {      id: 'INV006',      status: 'Pending',      method: 'Bank Transfer',      amount: '$200.00',    },    {      id: 'INV007',      status: 'Unpaid',      method: 'Credit Card',      amount: '$550.00',    },  ];}

Anatomy

Every part is a directive on the native element, so the table stays a table to screen readers: its caption names it, its header cells name their columns.

import {  ScTableContainer, ScTable, ScTableCaption, ScTableHeader,  ScTableBody, ScTableFooter, ScTableRow, ScTableHeaderCell,  ScTableCell,} from '@semantic-components/ui';
<div scTableContainer>  <table scTable>    <caption scTableCaption>…</caption>    <thead scTableHeader>      <tr scTableRow><th scTableHeaderCell>…</th></tr>    </thead>    <tbody scTableBody>      <tr scTableRow><td scTableCell>…</td></tr>    </tbody>    <tfoot scTableFooter>      <tr scTableRow><td scTableCell>…</td></tr>    </tfoot>  </table></div>

Notes

  • A table holds data, and data has column names: give it a header row, visually hidden when the look shows none (<thead scTableHeader class="sr-only">). Without header cells it is a layout table to checkers such as WAVE, and screen readers lose the column names. Rows of things that aren't data (recent activity, a feed) are a list: an Item group (role="list"). A grid with no column names to give is divs with ARIA roles, not a table (the Calendar's months view).
  • The container scrolls a wide table sideways instead of the page. Make it focusable and name it (tabindex="0" role="region" aria-label) when it may scroll, so the keyboard can reach what is hidden.
  • A header cell for a row, not a column, takes scope="row".
  • A row is highlighted on hover, while it holds an expanded control (aria-expanded, an open menu) and when it has data-state="selected".
  • Align numbers with text-end, not text-right: it follows the reading direction.

Examples

Footer

InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003PaidBank Transfer$350.00
Total$750.00
import { Component, ViewEncapsulation } from '@angular/core';import {  ScTable,  ScTableBody,  ScTableCell,  ScTableContainer,  ScTableFooter,  ScTableHeader,  ScTableHeaderCell,  ScTableRow,

Scrolling

OrderCustomerEmailDateStatusAmount
ORD-1042Olivia Martin[email protected]2026-10-28Shipped$1,999.00
ORD-1043Jackson Lee[email protected]2026-10-29Processing$39.00
ORD-1044Isabella Nguyen[email protected]2026-10-30Delivered$299.00
import { Component, ViewEncapsulation } from '@angular/core';import {  ScFrame,  ScTable,  ScTableBody,  ScTableCell,  ScTableContainer,  ScTableHeader,  ScTableHeaderCell,  ScTableRow,

RTL

قائمة بفواتيرك الأخيرة.
الفاتورةالحالةطريقة الدفعالمبلغ
INV001مدفوعةبطاقة ائتمان250.00 $
INV002معلقةPayPal150.00 $
INV003غير مدفوعةتحويل بنكي350.00 $
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation } from '@angular/core';import {  ScTable,  ScTableBody,  ScTableCaption,  ScTableCell,  ScTableContainer,  ScTableHeader,  ScTableHeaderCell,

API reference

Each part takes class, merged over the style (cn: a later class wins).

PartSelectorDescription
ScTableContainerdiv[scTableContainer] Scrolls a wide table sideways. Framed: add scFrame (the style’s frame).
ScTabletable[scTable] The table: full width, its text size from the style.
ScTableCaptioncaption[scTableCaption] Names the table; shown below it.
ScTableHeaderthead[scTableHeader] The header rows, a line below.
ScTableBodytbody[scTableBody] The rows; no line below the last.
ScTableFootertfoot[scTableFooter] Totals: muted, a line above.
ScTableRowtr[scTableRow] A row: a line below; highlighted on hover, with an expanded control, or data-state="selected".
ScTableHeaderCellth[scTableHeaderCell] Names its column (or its row, with scope="row").
ScTableCelltd[scTableCell] A cell; no padding at the end beside a checkbox.