The vscode-table component is a highly configurable table element designed to mimic the VS Code table experience. It supports column resizing, responsive layouts, and various styling options like zebra stripes and borders.
To use it, you must provide content via slots:
header slot: For vscode-table-header elements.body slot: For vscode-table-body elements.caption slot: For optional table captions.
If you do not specify slots, the component will attempt to assign vscode-table-header and vscode-table-body elements from the default slot to their respective named slots automatically.
<vscode-table
resizable
bordered
zebra
.columns='["100px", "auto", "50%"]'>
<div slot="header">
<vscode-table-header>
<vscode-table-header-cell>Name</vscode-table-header-cell>
<vscode-table-header-cell>Status</vscode-table-header-cell>
</vscode-table-header>
</div>
<div slot="body">
<vscode-table-body>
<vscode-table-row>
<vscode-table-cell>Item 1</vscode-table-cell>
<vscode-table-cell>Active</vscode-table-cell>
</vscode-table-row>
</vscode-table-body>
</div>
</vscode-table>