Users need to see structured data in a manner that makes the data readable, scannable, and comparable.
CBP theme version 1.6.0 update Class cbp-table is replaced by class table.
Description
Tables provide customizable views of tabular data with features including sorting and managing columns. Tables are useful when a collection of data requires vertical alignment through columns for quick scanning and discovery of information, as well as for data that with many attributes that requires sorting, grouping, and a user customizable display.
Basic Functionality
Tables list a collection of items in rows that have similar attributes, usually with headers to label each attribute.
The following functionality can be provided by tables:
Sorting by columns
Resizing columns
Showing and hiding columns
Reordering columns
Row selection
Performing actions on a row
A table’s complexity and needs can vary greatly. This pattern provides many different features a table may have. Features can be mixed and matched based on your needs. Don’t include features unless they’re actually needed.
Accessibility
Simple tables can have two levels of headers. Each header cell should have scope=”col” or scope=”row”.
Complex tables are tables with more than two levels of headers. Each header should be given a unique id and each data cell should have a headers attribute with each related header cell’s id listed.
When adding a title to a table, include it in a <caption> tag inside of the <table> element.
Examples
Standard Table
A standard table has subtle row borders.
Includes hover stylings with MDL additions Just by using the classnames: “table mdl-js-data-table”
Standard Table
Project name
Description
Price
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Comfortable Table
A standard table with extra padding and has subtle row borders.
Includes hover stylings with MDL additions Just by using the classnames: “table table-comfortable mdl-js-data-table”
Comfortable Table - table with extra padding
Project name
Description
Price
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Condensed Table
A standard table with less padding and has subtle row borders.
Includes hover stylings with MDL additions Just by using the classnames: “table table-condensed mdl-js-data-table”
Condensed Table - table with less padding
Project name
Description
Price
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Borderless Table
A standard table no border.
Includes hover stylings with MDL additions Just by using the classnames: “table table-borderless mdl-js-data-table”
Borderless Table - table with no border
Project name
Description
Price
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Outline Table
A standard table with outside border.
Includes hover stylings with MDL additions Just by using the classnames: “table table-outline mdl-js-data-table”
Outline Table - table with outside border
Project name
Description
Price
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Striped
A striped table adds an alternating row background color, increasing usability for wider tables.
Striped Table
Project name
Description
Price
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Table Headers
Fixed
A fixed header remains visible as the table body is scrolled. This is useful for larger amounts of data.
Fixed Header Table
Project name
Description
Price
Project name
Description
Price
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Sorting
Clicking a header cell sets that column as the currently sorted column. The first click should sort descending, the second click should sort ascending.
Single Sorting
Project name
Description
Price
Invoice
Add invoice confirmation
$4,500
Templates
Refactor templates to use the new templating library
$9,000
Payments
Process payments using third party api
$5,400
Account Management
Improve account management workflow
$6,000
Selection
Checkboxes are generally the best way to facilitate multi-row selection, especially if clicking a row already has a different action (e.g., opening an email).
Checking a checkbox should highlight the corresponding row.
If there’s a control for selecting all/none, it should represent the current state of the row selection, including an indeterminate state.
Selection
Material
Quantity
Unit price
Acrylic (Transparent)
25
$2.90
Acrylic (Transparent)
50
$1.25
Laminate (Gold on Blue)
10
$2.35
Row Action Buttons
Buttons with the btn-hover and btn-icon-only classes.