Table

The following shows how tables are styled. Basically it needs the following classes:

  • .table
    • .table__caption
    • colgroup have no specific class
      • col have no specific class
    • .table__thead
      • .table__tr
        • .table__th
    • .table__tbody
      • .table__tr
        • .table__td
    • .table__tfoot
      • .table__tr
        • .table__td

A table does not have to be created with the table tag. You can also build them with, for example, div elements. The advantage of the table tag is the use of the colgroup.

Theme basic Screen size XL
html

Variants

The following examples show variants of a table.

Content Right

With the class .table--content-right the first column is aligned left, all remaining columns are aligned right. The last column is omitting the default padding right.

Additional modifier for the table and it’s columns can still be set.

Theme basic Screen size XL
html

Content Center

With the class .table--content-center the first column is aligned left, all remaining columns are aligned center.

Additional modifier for the table and it’s columns can still be set.

Theme basic Screen size XL
html

First column headline

With the class .table--headline-first-col the first column is displayed similar to the table head in a different color and bold

Additional modifier for the table and it’s columns can still be set.

Theme basic Screen size XL
html

Table Modifiers

Great Modifiers are available to modify your table.

Fixed Table Modifier

The fixed table has a fixed height of 25rem. If there are a lot of Table Rows, the Content becomes vertically scrollable while the Table Head remains sticky on top. The modifier is added to the table tag and is called .table--fixed.

Theme basic Screen size XL
html

Alternate Row Colors

With the modifer .table--alternate every second row has a different color.

Theme basic Screen size XL
html

Hoverable Rows

With the modifier .table--hover every row will be visually highlighted by hovering the row.

Hovering is also possible, if the table has already alternated Colored Rows via .table--alternate.table--hover.

Theme basic Screen size XL
html

Column Width Modifier

Define the Column Width by using Global Size Modifiers

Theme basic Screen size XL
html

Column Specific Modifier

Use Column-specific Modifier for a specific Column

  • .table--col-{NUMBER}-suppress-line-breaks
  • .table--col-{NUMBER}-allow-line-breaks
  • .table--col-{NUMBER}-font-weight-bold
  • .table--col-{NUMBER}-font-weight-thin
  • .table--col-{NUMBER}-background-color-{colorname}
  • .table--col-{NUMBER}-font-color-{colorname}
  • .table--col-{NUMBER}-text-align-center
  • .table--col-{NUMBER}-text-align-left
  • .table--col-{NUMBER}-text-align-right

Possible Values for NUMBER are 1-10.

Additionally you can reset the first columns bold text by using

  • .table--col-1-font-weight-normal

  • .table--col-1-font-weight-normal - Reset the default, that first cols text is bold.

  • .table--col-2-suppress-line-breaks.table--col-3-allow-line-breaks - Add custom white-space behavior for second and third Columns.

  • .table--col-2-font-weight-bold.table--col-3-font-weight-bold - Add bold Font to all second and third Columns.

  • .table--col-2-text-align-center.table--col-3-text-align-right - Add custom text alignments to second and third Columns.

Theme basic Screen size XL
html

Suppresses Line Breaks

Text in Table-Heads will never break lines, so they are always without line-breaks.

Next to that you can add .table--suppress-line-breaks to the table-Element to avoid line breaks for all texts.

It’s also possible to define a specific Column with suppress-line-breaks by using .table--col-{NUMBER}-suppress-line-breaks

Finally you can also use .table__td--suppress-line-breaks to add avoid breaking lines for only a specific td.

Theme basic Screen size XL
html

Small Table

A Table with smaller sized Fonts.

Theme basic Screen size XL
html

Table Colors

Use the regular Global Color Modifiers to set .background-color-{COLORNAME} or .font-color-{COLORNAME}

Theme basic Screen size XL
html

The following Example shows a Table just with Links.

Theme basic Screen size XL
html

Full Example

The following Example shows how to combine all Modifer and represents a full featured Table.

This Table is also combined with an surrounding .horizontal-scrolling Modifier

Theme basic Screen size XL
html