Table Component

Table styling utilities from preset.css and table.css. The base <table> gets default borders, small header text, and hover on rows. Add utility classes for stripes, grid, alignment, states, and frozen columns.

Notes

Basic table

NameDepartmentRoleStatus
Zhang SanEngineeringSr. EngineerActive
Li SiMarketingManagerActive
Wang WuHRSpecialistOn leave

With tfoot

ProjectBudgetActualBalance
Project A$100K$85K$15K
Project B$200K$210K-$10K
Total$300K$295K$5K

States

table-selected (row highlight)

NameStatus
Zhang SanActive
Li SiActive (selected)
Wang WuOn leave

table-disabled (dimmed)

AccountStatus
adminNormal
deleted_userDeleted
editorNormal

table-focused (cell outline)

NameEmailRole
Zhang Sanzs@example.comAdmin
Li Sili@example.comEditor

Styles

table-stripe (odd rows)

#ProductPrice
1Laptop$999
2Mouse$49
3Keyboard$129
4Monitor$399

table-stripe-even

#ProductPrice
1Laptop$999
2Mouse$49
3Keyboard$129
4Monitor$399

table-hoverable (row hover)

NameEmail
Aa@test.com
Bb@test.com
Cc@test.com

table-intercell (cell hover outline)

NameEmail
Aa@test.com
Bb@test.com

table-crossable (cross highlight)

DateSalesOrders
Apr 1$12,50045
Apr 2$8,90032
Apr 3$15,20058

Stripe + hover combined

DateSalesOrders
Apr 1$12,50045
Apr 2$8,90032
Apr 3$15,20058
Apr 4$10,80041

Borders

table-borderless

NameRole
AAdmin
BEditor

table-bordered (with side borders)

NameRole
AAdmin
BEditor

table-grid (grid lines)

NameRole
AAdmin
BEditor

Grid + selected

NameRole
AAdmin
BEditor (selected)

Alignment

table-start (left, default)

NameSales
A$12,500

table-center

NameSales
A$12,500

table-end / table-right

NameSales
A$12,500

table-top (vertical)

NameNote
ALine 1
(top aligned)

table-bottom (vertical)

NameNote
ALine 1
(bottom aligned)

Layout

table-nowrap

NameVery long content that won't wrap
AThis is a very long text that stays on one line

Container (table-wrapper)

table-wrapper + table-fixed-header

#NameDepartmentRole
1Zhang SanEngineeringSr. Engineer
2Li SiMarketingManager
3Wang WuHRSpecialist
4Zhao LiuFinanceSupervisor
5Sun QiEngineeringDeveloper
6Zhou BaDesignDesigner
7Wu JiuEngineeringIntern
8Zheng ShiMarketingAnalyst

table-wrapper + table-fixed-end

NameEmailDepartmentRoleStatus
Zhang Sanzs@example.comEngineeringSr. EngineerActive
Li Sils@example.comMarketingManagerActive
Wang Wuww@example.comHRSpecialistOn leave

table-wrapper + table-fixed-start

NameEmailDepartmentRoleStatus
Zhang Sanzs@example.comEngineeringSr. EngineerActive
Li Sils@example.comMarketingManagerActive
Wang Wuww@example.comHRSpecialistOn leave

table-wrapper + table-fixed-start + table-fixed-header

NameEmailDepartmentRoleStatus
Zhang Sanzs@example.comEngineeringSr. EngineerActive
Li Sils@example.comMarketingManagerActive
Wang Wuww@example.comHRSpecialistOn leave
Zhao Liuzl@example.comFinanceSupervisorActive
Sun Qisq@example.comEngineeringDeveloperActive
Zhou Bazb@example.comDesignDesignerActive

table-wrapper + table-fixed-start + table-fixed-end

NameEmailDepartmentRoleStatus
Zhang Sanzs@example.comEngineeringSr. EngineerActive
Li Sils@example.comMarketingManagerActive
Wang Wuww@example.comHRSpecialistOn leave

table-wrapper + table-fixed-end + table-fixed-header

NameEmailDepartmentRoleStatus
Zhang Sanzs@example.comEngineeringSr. EngineerActive
Li Sils@example.comMarketingManagerActive
Wang Wuww@example.comHRSpecialistOn leave
Zhao Liuzl@example.comFinanceSupervisorActive
Sun Qisq@example.comEngineeringDeveloperActive
Zhou Bazb@example.comDesignDesignerActive