Skip to content

Table Styles ​

Provides fully-featured table styles with configurable colors, row behaviors, hover effects, sorting, expandable rows, and alignment utilities.

NameAgeEmail
John Doe20john@example.com
Jane Smith25jane.smith@example.com
Jack Ma39jack.ma@example.com
Lorem ipsum dolor sit amet consectetur adipiscing elit quisque faucibus ex sapien vitae pellentesque sem placerat in id cursus mi. 44jack.ma@example.com
NameAgeEmail
John Doe20john@example.com
Jane Smith25jane.smith@example.com
Jack Ma39jack.ma@example.com
Lorem ipsum dolor sit amet consectetur adipiscing elit quisque faucibus ex sapien vitae pellentesque sem placerat in id cursus mi. 44jack.ma@example.com

Usage ​

Signature:

scss
@mixin use-table($colors: ());

Example:

scss
// Apply all registered color variants
@include termeh.use-table();

// Apply only specific color variants
@include termeh.use-table(("primary", "error"));

Module:

This module is registered as table in the presented modules.

Dependencies

Table module uses the following Termeh global var():

ComponentTypeUsageDefault
base → colorColorFallback base table backgroundwhite
base → sectionColorFallback background for even rows and row hovernull
base → separatorColorFallback color for table separators and dividersnull
strong → weightStringFallback font weight for headersbold
table → backgroundColorMain table backgroundFALLBACK
table → foregroundColorDefault table text colornull
table → evenColorEven row backgroundFALLBACK
table → hoverColorHover row backgroundFALLBACK
table → gridColorGrid line colornull
table → dividerColorSection divider colorFALLBACK
table → separatorColorRow separator colorFALLBACK
table → decoratorColorSort decorator colorerror
table → sort-backgroundColorSorted column backgroundFALLBACK
table → strong-weightStringStrong font weight for headersFALLBACK

Table module uses the following Termeh color() and variant():

Color / VariantUsageDefault
primaryAccent color for scrollbarserror
shadeFallback color for sort backgrounds and decoratorserror

Table Container ​

You can wrap your table inside .table-container to enable scrolling on overflow.

Modifiers ​

  • .is-fullwidth → makes the table span 100% width
  • .is-stripped → applies alternating background to even rows
  • .is-hoverable → highlights rows on hover
  • .is-<color> → applies a registered color as accent color

Child Elements ​

  • <thead> → include header rows
    • <tr> → define a header row
      • <th> → define a header column
  • <tbody> → include table content
    • <tr> → define a body row
      • <td> → define a body column
  • <tfoot> → include table footer and summary
    • <tr> → define a footer row
      • <td> → define a footer column

Header Modifiers ​

  • .is-center-aligned → centers text inside column
  • .is-right-aligned → right-aligns text inside column
  • .is-left-aligned → left-aligns text inside column
  • .is-ellipsis → truncates overflowing text in column with ellipsis
  • .is-filler → expands column to fill remaining space
  • .is-sortable → makes a column sortable
  • .is-sorted → marks a column as sorted
  • .is-asc → marks sorted column as ascending
  • .is-desc → marks sorted column as descending
  • ROW

    • .is-even → applies alternate background to even rows
    • .extra → marks row as extra content for the previous row
    • .is-expanded → shows the next .extra row
  • COLUMN

    • .is-center-aligned → centers text inside column
    • .is-right-aligned → right-aligns text inside column
    • .is-left-aligned → left-aligns text inside column
    • .is-ellipsis → truncates overflowing text in column with ellipsis
    • .is-filler → expands column to fill remaining space
    • .is-multiline → allows multi-line text inside column
    • .is-sorted → marks a column as sorted
    • .is-<color> → apply light highlight to column