Table

Standard Table

Tables are styled to match the look of awesomeness. On smaller screen you can add a label to each table-data by using the data-attribute data-label.

Example

First NameLast NameJob TitleFavorite ColorWars or Trek?Porn NameDate of Birth
JamesMatmanChief Sandwich EaterLettuce GreenTrekDigby GreenJanuary 13, 1979
TheTickCrimefighter SortaBlueWarsJohn SmithJuly 19, 1968
JokeySmurfGiving Exploding PresentsSmurflowSmurfSmurflane SmurfmuttSmurfuary Smurfteenth, 1945
CindyBeylerSales RepresentativeRedWarsLori QuiveyJuly 5, 1956
CaptainCoolTree CrusherBlueWarsSteve 42ndDecember 13, 1982

Imports

  • SASS:
    @import "base";
    @import "imports/modules/table";

Code

<table class="table">
	<thead>
		<tr>
			<th>First Name</th>
			<th>Last Name</th>
			<th>...</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td data-label="First Name">James</td>
			<td data-label="Last Name">Matman</td>
			<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">The</td>
		  	<td data-label="Last Name">Tick</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">Jokey</td>
		  	<td data-label="Last Name">Smurf</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">Cindy</td>
		  	<td data-label="Last Name">Beyler</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name"Captain</td>
		  	<td data-label="Last Name">Cool</td>
		  	<td>...</td>
		</tr>
	</tbody>
</table>

Different States

Table rows can have three different states by adding the following classes to the tr element: .table__row--selected, .table__row--lastedited & .table__row--disabled.

Example

First NameLast NameJob TitleFavorite ColorWars or Trek?Porn NameDate of Birth
TheTickCrimefighter SortaBlueWarsJohn SmithJuly 19, 1968
JamesMatmanChief Sandwich EaterLettuce GreenTrekDigby GreenJanuary 13, 1979
TheTickCrimefighter SortaBlueWarsJohn SmithJuly 19, 1968
TheTickCrimefighter SortaBlueWarsJohn SmithJuly 19, 1968
TheTickCrimefighter SortaBlueWarsJohn SmithJuly 19, 1968
JokeySmurfGiving Exploding PresentsSmurflowSmurfSmurflane SmurfmuttSmurfuary Smurfteenth, 1945
TheTickCrimefighter SortaBlueWarsJohn SmithJuly 19, 1968

Imports

  • SASS:
    @import "base";
    @import "imports/modules/table";

Code

<table class="table">
	<thead>
		<tr>
			<th>First Name</th>
			<th>Last Name</th>
			<th>...</th>
		</tr>
	</thead>
	<tbody>
		<tr>
		  	<td data-label="First Name">The</td>
		  	<td data-label="Last Name">Tick</td>
		  	<td>...</td>
		</tr>
		<tr class="table__row--selected">
			<td data-label="First Name">James</td>
			<td data-label="Last Name">Matman</td>
			<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">The</td>
		  	<td data-label="Last Name">Tick</td>
		  	<td>...</td>
		</tr>
		<tr class="table__row--lastedited">
		  	<td data-label="First Name">The</td>
		  	<td data-label="Last Name">Tick</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">The</td>
		  	<td data-label="Last Name">Tick</td>
		  	<td>...</td>
		</tr>
		<tr class="table__row--disabled">
		  	<td data-label="First Name">Jokey</td>
		  	<td data-label="Last Name">Smurf</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">The</td>
		  	<td data-label="Last Name">Tick</td>
		  	<td>...</td>
		</tr>
	</tbody>
</table>

Condensed Table

If you want a table to show up with less padding and a smaller font-size just add the class .table--condensed to it and see the result:

Example

First NameLast NameJob TitleFavorite ColorWars or Trek?Porn NameDate of Birth
JamesMatmanChief Sandwich EaterLettuce GreenTrekDigby GreenJanuary 13, 1979
TheTickCrimefighter SortaBlueWarsJohn SmithJuly 19, 1968
JokeySmurfGiving Exploding PresentsSmurflowSmurfSmurflane SmurfmuttSmurfuary Smurfteenth, 1945
CindyBeylerSales RepresentativeRedWarsLori QuiveyJuly 5, 1956
CaptainCoolTree CrusherBlueWarsSteve 42ndDecember 13, 1982

Imports

  • SASS:
    @import "base";
    @import "imports/modules/table";

Code

<table class="table table--condensed">
	<thead>
		<tr>
			<th>First Name</th>
			<th>Last Name</th>
			<th>...</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td data-label="First Name">James</td>
			<td data-label="Last Name">Matman</td>
			<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">The</td>
		  	<td data-label="Last Name">Tick</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">Jokey</td>
		  	<td data-label="Last Name">Smurf</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">Cindy</td>
		  	<td data-label="Last Name">Beyler</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">Captain</td>
		  	<td data-label="Last Name">Cool</td>
		  	<td>...</td>
		</tr>
	</tbody>
</table>

Table with Dividers

A table can also have some dividers in it. Simply add the class .table__row--divider to a row to style it like a table header.

Example

First NameLast NameJob TitleFavorite ColorWars or Trek?Porn NameDate of Birth
JamesMatmanChief Sandwich EaterLettuce GreenTrekDigby GreenJanuary 13, 1979
TheTickCrimefighter SortaBlueWarsJohn SmithJuly 19, 1968
JokeySmurfGiving Exploding PresentsSmurflowSmurfSmurflane SmurfmuttSmurfuary Smurfteenth, 1945
CindyBeylerSales RepresentativeRedWarsLori QuiveyJuly 5, 1956
CaptainCoolTree CrusherBlueWarsSteve 42ndDecember 13, 1982
JamesMatmanChief Sandwich EaterLettuce GreenTrekDigby GreenJanuary 13, 1979
TheTickCrimefighter SortaBlueWarsJohn SmithJuly 19, 1968

Imports

  • SASS:
    @import "base";
    @import "imports/modules/table";

Code

<table class="table table--condensed">
	<thead>
		<tr>
			<th data-label="First Name">First Name</th>
			<th data-label="Last Name">Last Name</th>
			<th>...</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td data-label="First Name">James</td>
			<td data-label="Last Name">Matman</td>
			<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">The</td>
		  	<td data-label="Last Name">Tick</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">Jokey</td>
		  	<td data-label="Last Name">Smurf</td>
		  	<td>...</td>
		</tr>
		<tr class="table__row--divider">
		  	<td data-label="First Name">Cindy</td>
		  	<td data-label="Last Name">Beyler</td>
		  	<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">Captain</td>
		  	<td data-label="Last Name">Cool</td>
		  	<td>...</td>
		</tr>
		<tr>
			<td data-label="First Name">James</td>
			<td data-label="Last Name">Matman</td>
			<td>...</td>
		</tr>
		<tr>
		  	<td data-label="First Name">The</td>
		  	<td data-label="Last Name">Tick</td>
		  	<td>...</td>
		</tr>
	</tbody>
</table>