Tables

Structured tabular data with bordered, striped, hoverable, and compact styles, plus responsive horizontal scrolling for wide datasets.

Bordered Table
NameEmailRole
John Doejohn@example.comAdmin
Jane Smithjane@example.comUser
Mike Johnsonmike@example.comUser
<!-- Bordered Table -->
<table class="vd-table vd-table-bordered">
  <thead>
    <tr><th>Name</th><th>Email</th><th>Role</th></tr>
  </thead>
  <tbody>
    <tr><td>John Doe</td><td>john@example.com</td><td>Admin</td></tr>
    <tr><td>Jane Smith</td><td>jane@example.com</td><td>User</td></tr>
    <tr><td>Mike Johnson</td><td>mike@example.com</td><td>User</td></tr>
  </tbody>
</table>
Striped Table
ProductPriceStock
Product A$29.9950
Product B$39.9930
Product C$49.9920
<!-- Striped Table -->
<table class="vd-table vd-table-striped">
  <thead>
    <tr><th>Product</th><th>Price</th><th>Stock</th></tr>
  </thead>
  <tbody>
    <tr><td>Product A</td><td>$29.99</td><td>50</td></tr>
    <tr><td>Product B</td><td>$39.99</td><td>30</td></tr>
    <tr><td>Product C</td><td>$49.99</td><td>20</td></tr>
  </tbody>
</table>
Hover Table
IDStatusDate
#001Active2024-01-15
#002Pending2024-01-16
#003Failed2024-01-17
<!-- Hover Table -->
<table class="vd-table vd-table-hover">
  <thead>
    <tr><th>ID</th><th>Status</th><th>Date</th></tr>
  </thead>
  <tbody>
    <tr><td>#001</td><td><span class="vd-badge vd-badge-success">Active</span></td><td>2024-01-15</td></tr>
    <tr><td>#002</td><td><span class="vd-badge vd-badge-warning">Pending</span></td><td>2024-01-16</td></tr>
    <tr><td>#003</td><td><span class="vd-badge vd-badge-danger">Failed</span></td><td>2024-01-17</td></tr>
  </tbody>
</table>
Usage
<script setup lang="ts">
import { VdTable } from "@vanduo-oss/vd3";
const columns = [
  { key: "name", label: "Name" },
  { key: "status", label: "Status", variant: "success" },
];
const rows = [{ name: "Build", status: "Passing" }];
</script>

<template>
  <VdTable :columns="columns" :rows="rows" striped hover caption="CI status" />
</template>

API Reference

Class NameDescriptionType
.vd-tableBase component class required for all Vanduo tables.Component
.vd-table-borderedModifier class that adds borders to all outer boundaries and internal cells.Modifier
.vd-table-stripedModifier class that adds alternating background colors to body rows (zebra striping).Modifier
.vd-table-hoverModifier class that enables a hover background color effect on body rows.Modifier
.vd-table-responsiveWrapper class that enables horizontal scrolling on small screens.Layout

Component API (Vue 3)

PropDescription
:columnsArray of { key, label, variant? } — variant tints the column header (primary|secondary|success|warning|error|info).
:rowsArray of plain row objects keyed by each column's key.
:stripedZebra row striping.
:borderedCell borders.
:hoverRow hover highlight.
:captionAccessible table caption.