Used to display data in a tabular format.
Shopping Cart| # | Product | Quantity | Price | Total |
|---|
| 1 | Product 1 | 1 | 100 | 100 |
| 2 | Product 2 | 2 | 200 | 400 |
| 3 | Product 3 | 3 | 300 | 900 |
| Total | | 6 | | 1500 |
Shopping Cart | # | Product | Quantity | Price | Total |
|---|
| 1 | Product 1 | 1 | 100 | 100 |
| 2 | Product 2 | 2 | 200 | 400 |
| 3 | Product 3 | 3 | 300 | 900 |
| Total | | 6 | | 1500 |
import { Table } from '@fintech-sandpit/ui/react';
<div className="max-w-[50%] max-h-[200px] overflow-auto whitespace-nowrap pr-1 pb-1">
<Table.ColumnHeader sticky="5rem">#</Table.ColumnHeader>
<Table.ColumnHeader>Product</Table.ColumnHeader>
<Table.ColumnHeader>Quantity</Table.ColumnHeader>
<Table.ColumnHeader>Price</Table.ColumnHeader>
<Table.ColumnHeader>Total</Table.ColumnHeader>
<Table.Cell sticky="5rem">1</Table.Cell>
<Table.Cell>Product 1</Table.Cell>
<Table.Cell>1</Table.Cell>
<Table.Cell>100</Table.Cell>
<Table.Cell>100</Table.Cell>
<Table.Cell sticky="5rem">2</Table.Cell>
<Table.Cell>Product 2</Table.Cell>
<Table.Cell>2</Table.Cell>
<Table.Cell>200</Table.Cell>
<Table.Cell>400</Table.Cell>
<Table.Cell sticky="5rem">3</Table.Cell>
<Table.Cell>Product 3</Table.Cell>
<Table.Cell>3</Table.Cell>
<Table.Cell>300</Table.Cell>
<Table.Cell>900</Table.Cell>
<Table.Cell sticky="5rem">Total</Table.Cell>
<Table.Cell>6</Table.Cell>
<Table.Cell>1500</Table.Cell>
import { Table } from '@fintech-sandpit/ui/vue';
<div class="max-w-[50%] max-h-[200px] overflow-auto whitespace-nowrap pr-1 pb-1">
<Table.ColumnHeader sticky="5rem">
<Table.ColumnHeader>Product</Table.ColumnHeader>
<Table.ColumnHeader>Quantity</Table.ColumnHeader>
<Table.ColumnHeader>Price</Table.ColumnHeader>
<Table.ColumnHeader>Total</Table.ColumnHeader>
<Table.Cell sticky="5rem">
<Table.Cell>Product 1</Table.Cell>
<Table.Cell>1</Table.Cell>
<Table.Cell>100</Table.Cell>
<Table.Cell>100</Table.Cell>
<Table.Cell sticky="5rem">
<Table.Cell>Product 2</Table.Cell>
<Table.Cell>2</Table.Cell>
<Table.Cell>200</Table.Cell>
<Table.Cell>400</Table.Cell>
<Table.Cell sticky="5rem">
<Table.Cell>Product 3</Table.Cell>
<Table.Cell>3</Table.Cell>
<Table.Cell>300</Table.Cell>
<Table.Cell>900</Table.Cell>
<Table.Cell sticky="5rem">
<Table.Cell>6</Table.Cell>
<Table.Cell>1500</Table.Cell>
| Name | Type | Required | Default | Description |
|---|
size | Size | | md | The size of the table |
dense | boolean | | false | Whether to use a dense table |
showBorder | boolean | | false | Whether to show the table border |
showRowStripe | boolean | | false | Whether to show the row stripe |
showRowBorder | boolean | | false | Whether to show the row border |
showColumnBorder | boolean | | false | Whether to show the column border |
| Name | Type | Required | Default | Description |
|---|
size | Size | | md | The size of the table |
dense | boolean | | false | Whether to use a dense table |
show-border | boolean | | false | Whether to show the table border |
show-row-stripe | boolean | | false | Whether to show the row stripe |
show-row-border | boolean | | false | Whether to show the row border |
show-column-border | boolean | | false | Whether to show the column border |
| Name | Type | Required | Default | Description |
|---|
sticky | boolean | | false | Whether to make the header sticky |
| Name | Type | Required | Default | Description |
|---|
sticky | CssUnit | boolean | | — | Whether to make the column header sticky 1 |
colSpan | number | | — | The number of columns the column header should span |
rowSpan | number | | — | The number of rows the column header should span |
| Name | Type | Required | Default | Description |
|---|
sticky | CssUnit | boolean | | — | Whether to make the column header sticky 1 |
col-span | number | | — | The number of columns the column header should span |
row-span | number | | — | The number of rows the column header should span |
- Set
width CSS property to make the column header sticky.
| Name | Type | Required | Default | Description |
|---|
sticky | CssUnit | boolean | | — | Whether to make the cell sticky 1 |
colSpan | number | | — | The number of columns the cell should span |
rowSpan | number | | — | The number of rows the cell should span |
| Name | Type | Required | Default | Description |
|---|
sticky | CssUnit | boolean | | — | Whether to make the cell sticky 1 |
col-span | number | | — | The number of columns the cell should span |
row-span | number | | — | The number of rows the cell should span |
- Set
width CSS property to make the cell sticky.
type CssUnit = `${number}${'em' | 'px' | 'rem' | 'vh' | 'vw' | '%'}`
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'