For basic styling—light padding and only horizontal dividers—add the base class .cs-table to any <table>. It may seem super redundant, but given the widespread use of tables for other plugins like calendars and date pickers, we’ve opted to isolate our custom table styles.
[cs_divider_icon align=”left” text=”Table Basic” color=”#bbbbbb”][/cs_divider_icon]
[cs_table]
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird |
[/cs_table]
[cs_divider_icon align=”left” text=”Table Striped rows” color=”#bbbbbb”][/cs_divider_icon]
[cs_table striped=”1″]
Use .cs-table-striped to add zebra-striping to any table row within the <tbody>.
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird |
[/cs_table]
[cs_divider_icon align=”left” text=”Table Bordered” color=”#bbbbbb”][/cs_divider_icon]
[cs_table bordered=”1″]
Add .cs-table-bordered for borders on all sides of the table and cells.
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird |
[/cs_table]
[cs_divider_icon align=”left” text=”Table Hover” color=”#bbbbbb”][/cs_divider_icon]
[cs_table hover=”1″]
Add .cs-table-hover to enable a hover state on table rows within a <tbody>.
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird |
[/cs_table]
[cs_divider_icon align=”left” text=”Table Condensed” color=”#bbbbbb”][/cs_divider_icon]
[cs_table condensed=”1″]
Add .cs-table-condensed to make tables more compact by cutting cell padding in half.
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird |
[/cs_table]
[cs_divider_icon align=”left” text=”Table Responsive” color=”#bbbbbb”][/cs_divider_icon]
[cs_table responsive=”1″]
Create responsive tables by wrapping any .cs-table in .cs-table-responsive to make them scroll horizontally on small devices (under 768px). When viewing on anything larger than 768px wide, you will not see any difference in these tables.
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird |
[/cs_table]