Table Cell
<sl-table-cell> | SlTableCell
Member of a table row.
<sl-table-cell>Content</sl-table-cell>
Examples
Set custom width
<sl-table-cell style="--width: 300px; border: 1px dashed">Content</sl-table-cell>
Alignment
<sl-table-cell style="--width: 300px" align="right">Right aligned</sl-table-cell> <br> <sl-table-cell style="--width: 300px" align="center">Center aligned</sl-table-cell> <br> <sl-table-cell style="--width: 300px" align="left">Left aligned</sl-table-cell> <br>
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://v2-48-10.yoummday-theme.pages.dev/components/table-cell/table-cell.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://v2-48-10.yoummday-theme.pages.dev/components/table-cell/table-cell.js';
To import this component using a bundler:
import '@yoummday/ymmd-shoelace/dist/components/table-cell/table-cell.js';
To import this component as a React component:
import SlTableCell from '@yoummday/ymmd-shoelace/dist/react/table-cell';
Slots
| Name | Description |
|---|---|
| (default) | The default slot. |
Learn more about using slots.
Properties
| Name | Description | Reflects | Type | Default |
|---|---|---|---|---|
align
|
The horizontal alignment of the cell. |
|
'left' | 'right' | 'center' | undefined
|
- |
sortable
|
The column name to sort by. Only effective for table head cells. |
|
string | undefined
|
- |
direction
|
The sort direction. Only effective for table head cells. |
'asc' | 'desc'
|
'asc'
|
|
active
|
Whether the column is actively sorted. Only effective for table head cells. |
|
boolean
|
false
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
Learn more about attributes and properties.
Events
| Name | React Event | Description | Event Detail |
|---|---|---|---|
sl-sort-request |
onSlSortRequest |
Emitted when the column is selected for sorting. | - |
Learn more about events.
Custom Properties
| Name | Description | Default |
|---|---|---|
--width |
Set a fixed width for the cell. (default: 100%) |
Learn more about customizing CSS custom properties.
Parts
| Name | Description |
|---|---|
base |
The component’s base wrapper. |
Learn more about customizing CSS parts.