Material Design Lite Table
what is Tables in (MDL) ?
- Material Design Lite(MDL) component data-table is used to create an table which is an enhanced version of HTML5 Table
- A Data Table comprises of a rows and columns of well formatted data, displayed with typical MDL user interaction capabilities.
- Tables find usage in almost all types of webpages to display structured data, hence the design and placement of tables has a huge impact on user experience.
- The individual cells of the table are self-formatting, with minimal attention required to format them.
- The Date-table Component automatically applies shadow and other effects on mouseover and selection, user can format cells by using specific classes for non-numbered values, selectable values within the table.
Material Design Lite(MDL) Tables : Numerical Values
- A MDL Data Table is created by using class mdl-data-table within the element table
- The Data-Table is by default formatted for holding numeric values, i.e the displayed values are aligned to the right-side of the table cell.
Sample Code for Numerical Values
- Note: The Data-table cells are formatted as numeric by default.
Material Design Lite(MDL) Tables : Non-Numerical Values
- A MDL Data Table for non numeric values can be created using class mdl-data-table__cell--non-numeric
- This Class displays the text content within table cells aligned to the left corner.
Sample Code for Non-numerical Values
- Note: The Data-table cells are formatted as numeric by default.
Material Design Lite(MDL) Tables : Numerical and Non Numerical Hybrid
Sample Code for Numerical and Non Numeric Values
- Note: The Data-table cells are formatted as numeric by default.
Material Design Lite(MDL) Tables : Selectable Tables
- A MDL Data Table with selectable table rows is created using class mdl-data-table--selectable.
- The Selection checkbox have both the visual appearance and functionality same as that of a checkbox.
Sample Code for Selectable Tables
- Note: The Data-table cells are formatted as numeric by default.
Material Design Lite : Data-Table Classes
MDL Class | Description |
---|---|
mdl-data-table | To create a MDL Table container |
mdl-js-data-table | To Assign MDL behaviour to Tables |
mdl-data-table--selectable | To create table with individual selectable rows |
mdl-data-table__cell--non-numeric | To apply text formatting to data cell |
none | The default table cell formatting for numeric values |