Table

Apply responsive styles to a native HTML table.

A list of your recent invoices.
InvoiceStatusMethodAmount
INV001PaidCredit Card$250.00
INV002PendingPayPal$150.00
INV003UnpaidBank Transfer$350.00
INV004PaidCredit Card$450.00
INV005PaidPayPal$550.00
INV006PendingBank Transfer$200.00
INV007UnpaidCredit Card$300.00
Total$2,500.00

Installation

npx nx g @spartan-ng/cli:ui table

Usage

import { HlmTableImports } from '@spartan-ng/helm/table';
<table hlmTable>
	<caption hlmCaption>A list of your recent invoices.</caption>
	<thead hlmTHead>
		<tr hlmTr>
			<th hlmTh class="w-[100px]">Invoice</th>
			<th hlmTh>Status</th>
			<th hlmTh>Method</th>
			<th hlmTh class="text-right">Amount</th>
		</tr>
	</thead>
	<tbody hlmTBody>
		@for (invoice of _invoices; track invoice.invoice) {
			<tr hlmTr>
				<td hlmTd class="font-medium">{{ invoice.invoice }}</td>
				<td hlmTd>{{ invoice.paymentStatus }}</td>
				<td hlmTd>{{ invoice.paymentMethod }}</td>
				<td hlmTd class="text-right">{{ invoice.totalAmount }}</td>
			</tr>
		}
	</tbody>
	<tfoot hlmTFoot>
		<tr hlmTr>
			<td hlmTd [attr.colSpan]="3">Total</td>
			<td hlmTd class="text-right">$2,500.00</td>
		</tr>
	</tfoot>
</table>

Helm API

HlmTable

Selector: table[hlmTable]

Inputs

PropTypeDefaultDescription
hlmTable Partial<HlmTableVariant> | string {} Input to configure the variant of the table, this input has the highest priority.
class ClassValue --

HlmTHead

Selector: thead[hlmTHead]

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmTBody

Selector: tbody[hlmTBody]

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmTFoot

Selector: tfoot[hlmTFoot]

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmTr

Selector: tr[hlmTr]

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmTh

Selector: th[hlmTh]

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmTd

Selector: td[hlmTd]

Inputs

PropTypeDefaultDescription
class ClassValue --

HlmCaption

Selector: caption[hlmCaption]

Inputs

PropTypeDefaultDescription
class ClassValue --

Data Table

For more complex tables, have a look at the data table , which is powered by the incredible work of TanStack-Table .

See the Data Table documentation for more information.

Tabs Switch