Skip to main content
In Review

Table

Basic Table

Table Header
NameEmailRole
John Doejohn.doe@example.comAdmin
Jane Smithjane.smith@example.comUser
Sam Leesam.lee@example.comEditor

Usage

<table class="gi-table">
  <caption class="gi-table-caption-text gi-text-lg">Default Table Example</caption>
  <thead>
    <tr>
      <th class="gi-table-th">Name</th>
      <th class="gi-table-th">Email</th>
      <th class="gi-table-th">Role</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td class="gi-table-td">John Doe</td>
      <td class="gi-table-td">john.doe@example.com</td>
      <td class="gi-table-td">Admin</td>
    </tr>
    <tr>
      <td class="gi-table-td">Jane Smith</td>
      <td class="gi-table-td">jane.smith@example.com</td>
      <td class="gi-table-td">User</td>
    </tr>
    <tr>
      <td class="gi-table-td">Sam Lee</td>
      <td class="gi-table-td">sam.lee@example.com</td>
      <td class="gi-table-td">Editor</td>
    </tr>
  </tbody>
</table>
{{ govieTable({
"captionText": "Default Table Example",
"headers": [
  "Name",
  "Email",
  "Role"
],
"rows": [
  [
    "John Doe",
    "john.doe@example.com",
    "Admin"
  ],
  [
    "Jane Smith",
    "jane.smith@example.com",
    "User"
  ],
  [
    "Sam Lee",
    "sam.lee@example.com",
    "Editor"
  ]
]
}) }}
import React from 'react';
import {
  Table,
  Caption,
  TableHead,
  TableRow,
  TableHeader,
  TableData,
  TableBody,
} from '@govie-ds/react';
<Table>
<Caption>
  User Information
</Caption>
<TableHead>
  <TableRow>
    <TableHeader>
      Name
    </TableHeader>
    <TableHeader>
      Email
    </TableHeader>
    <TableHeader>
      Role
    </TableHeader>
  </TableRow>
</TableHead>
<TableBody>
  <TableRow>
    <TableData>
      John Doe
    </TableData>
    <TableData>
      john.doe@example.com
    </TableData>
    <TableData>
      Admin
    </TableData>
  </TableRow>
  <TableRow>
    <TableData>
      Jane Smith
    </TableData>
    <TableData>
      jane.smith@example.com
    </TableData>
    <TableData>
      User
    </TableData>
  </TableRow>
  <TableRow>
    <TableData>
      Sam Lee
    </TableData>
    <TableData>
      sam.lee@example.com
    </TableData>
    <TableData>
      Editor
    </TableData>
  </TableRow>
</TableBody>
</Table>

Best Practices

When to use this component

When not to use this component

Status

Figma Library
Considering
Local HTML
Stable
Global HTML
Beta
Global React
Beta