Skip to content
OGE logoOGE

Simple Table API

Full surface of oge-simple-table: its inputs and model, the page method, the four structural template slots with their typed contexts, and the config provider.

Properties Methods Events Types

OgeSimpleTable

oge-simple-table

Properties 10

Data

Name Type DefaultDescription
valuereadonly T[][]The rows.
columnsreadonly OgeSimpleTableColumn[] | undefined—Header cells and default cells. Unset: one column per own key of the first row.

Paging

Name Type DefaultDescription
pagingbooleanfalseShows pageSize rows at a time with a previous / next pager and a {from}–{to} of {count} text (announced politely).
pageSizenumber | undefinedconfig ?? 10Rows per page with paging.
pageIndexnumber00-based page shown (two-way [(pageIndex)]), clamped into range.

Presentation

Name Type DefaultDescription
compactboolean | undefinedconfig ?? falseDenser rows (4px 8px cell padding instead of the token).
captionstring | undefined—A visible <caption> — the table’s accessible name.
ariaLabelstring | undefined—The accessible name when there is no visible caption.
scrollablebooleantrueWraps the table in a focusable, labelled scroll region, so a wide table scrolls inside itself on a narrow screen instead of widening the page.
localestring | undefined—BCP 47 locale of the pager’s numbers; falls back to the config, then the application locale.

Methods 1

Name Type Description
goToPage(index)(index: number) => voidShows a page, clamped into range.

Events 1

Name Type Description
pageIndexChangenumberThe banana half of [(pageIndex)].

Types 9

Slots

Name Type Description
OgeSimpleTableRow[ogeSimpleTableRow]The markup of each row — a whole <tr> with free <td>s. Bind [ogeSimpleTableRowOf] to the same array as value and let-row is typed under strictTemplates (ngTemplateContextGuard).
OgeSimpleTableHeader[ogeSimpleTableHeader]Replaces the header row(s) inside <thead> — grouped headers, colspan. Give each <th> a scope.
OgeSimpleTableFooter[ogeSimpleTableFooter]Rows of a <tfoot> — totals, notes; let-all="rows" is every row of value.
OgeSimpleTableEmpty[ogeSimpleTableEmpty]Content of the full-width cell shown when value is empty (default: the noData message).
OgeSimpleTableRowContext{ $implicit: T; columns: readonly OgeSimpleTableResolvedColumn[]; rowIndex: number }Context of the row template; rowIndex counts in value, not in the page.
OgeSimpleTableSectionContext{ $implicit: readonly OgeSimpleTableResolvedColumn[]; rows: readonly T[] }Context of the header and footer templates.

Vocabulary

Name Type Description
OgeSimpleTableColumn{ field?: string; caption?: string; align?: OgeSimpleTableAlign; width?: string; cssClass?: string }One column: its header cell, and the default cell when no row template is given. field takes dot paths; caption defaults to the field, humanized; width goes on the column’s <col>.
OgeSimpleTableAlign'start' | 'center' | 'end'Alignment of a column’s header and cells (logical: end is the left edge in a right-to-left page).
OgeSimpleTableResolvedColumnOgeSimpleTableColumn & { caption: string; align: OgeSimpleTableAlign; cellClass: string }A column as templates receive it. cellClass carries the alignment and cssClass: put it on a <td> of your own row to line it up with its header.

Configuration

Properties 2

Name Type Description
provideOgeSimpleTableConfig(config)(config: OgeSimpleTableConfigInput | (() => OgeSimpleTableConfigInput)) => ProviderApplication- or component-scoped defaults for pageSize, compact, locale and the messages; a function makes them live (switching the UI language without a reload).
OGE_SIMPLE_TABLE_CONFIGInjectionToken<OgeSimpleTableConfig>The token behind the provider.

Types 5

Name Type Description
OgeSimpleTableConfiginterfaceThe resolved config (messages, pageSize?, compact?, locale?).
OgeSimpleTableConfigInputinterfaceThe partial input both providers accept (messages merged one level deep).
OGE_DEFAULT_SIMPLE_TABLE_CONFIGOgeSimpleTableConfigThe resolved defaults.
OgeSimpleTableMessagesinterfaceEvery user-facing string: pager (the pager group’s name), previousPage, nextPage, pageInfo ({from} {to} {count}) and noData. Translated in every @oge-ui/locales pack (layout.simpleTable).
OGE_DEFAULT_SIMPLE_TABLE_MESSAGESOgeSimpleTableMessagesThe English catalog.