Materialize CSS provides different predefined table classes that are used with HTML basic tables. These classes make the table too elegant. You can also make the Materialize table responsive, which will be looking good on any device breakpoints.
Materialize table is divided into the following parts.
It is a basic table without any border.Do not need to assign any class to the <table>
element base class.
Name | Mobile | Email ID |
---|---|---|
John Smith | 7894xxxx45 | johnsmith@gmail.com |
Jane | 78xx56xx78 | jane@gmail.com |
General Syntax
<table></table>
Source Code
<table>
<thead>
<tr>
<th>Name</th>
<th>Mobile</th>
<th>Email ID</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Smith</td>
<td>7894xxxx45</td>
<td>johnsmith@gmail.com</td>
</tr>
<tr>
<td>Jane</td>
<td>78xx56xx78</td>
<td>jane@gmail.com</td>
</tr>
</tbody>
</table>
To create bordered table, add .bordered
class to the table
element base class.
Name | Mobile | Email ID |
---|---|---|
John Smith | 7894xxxx45 | johnsmith@gmail.com |
Jane | 78xx56xx78 | jane@gmail.com |
General Syntax
<table class="bordered"></table>
Source Code
<table class="bordered">
<thead>
<tr>
<th>Name</th>
<th>Mobile</th>
<th>Email ID</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Smith</td>
<td>7894xxxx45</td>
<td>johnsmith@gmail.com</td>
</tr>
<tr>
<td>Jane</td>
<td>78xx56xx78</td>
<td>jane@gmail.com</td>
</tr>
</tbody>
</table>
To create stripped table, assign .striped
class to the table
element base class.
Name | Mobile | Email ID |
---|---|---|
John Smith | 7894xxxx45 | johnsmith@gmail.com |
Jane | 78xx56xx78 | jane@gmail.com |
General Syntax
<table class="striped"></table>
Source Code
<table class="striped ">
<thead>
<tr>
<th>Name</th>
<th>Mobile</th>
<th>Email ID</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Smith</td>
<td>7894xxxx45</td>
<td>johnsmith@gmail.com</td>
</tr>
<tr>
<td>Jane</td>
<td>78xx56xx78</td>
<td>jane@gmail.com</td>
</tr>
</tbody>
</table>
To Create Materialize CSS highlight table, add .highlight
class to the <table>
element base class.
Name | Mobile | Email ID |
---|---|---|
John Smith | 7894xxxx45 | johnsmith@gmail.com |
Jane | 78xx56xx78 | jane@gmail.com |
General Syntax
<table class="highlight"></table>
Source Code
<table class="highlight ">
<thead>
<tr>
<th>Name</th>
<th>Mobile</th>
<th>Email ID</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Smith</td>
<td>7894xxxx45</td>
<td>johnsmith@gmail.com</td>
</tr>
<tr>
<td>Jane</td>
<td>78xx56xx78</td>
<td>jane@gmail.com</td>
</tr>
</tbody>
</table>
To create materialize CSS centered table, assign .centered
class to the table
element base class.
Name | Mobile | Email ID |
---|---|---|
John Smith | 7894xxxx45 | johnsmith@gmail.com |
Jane | 78xx56xx78 | jane@gmail.com |
General Syntax
<table class="centered"></table>
Source Code
<table class="centered ">
<thead>
<tr>
<th>Name</th>
<th>Mobile</th>
<th>Email ID</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Smith</td>
<td>7894xxxx45</td>
<td>johnsmith@gmail.com</td>
</tr>
<tr>
<td>Jane</td>
<td>78xx56xx78</td>
<td>jane@gmail.com</td>
</tr>
</tbody>
</table>
To create Materialize CSS responsive table, assign .responsive-table
class to the <table>
element base class.
Name | Mobile | Email ID |
---|---|---|
John Smith | 7894xxxx45 | johnsmith@gmail.com |
Jane | 78xx56xx78 | jane@gmail.com |
General Syntax
<table class="responsive-table"></table>
Source Code
<table class="responsive-table">
<thead>
<tr>
<th>Name</th>
<th>Mobile</th>
<th>Email ID</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Smith</td>
<td>7894xxxx45</td>
<td>johnsmith@gmail.com</td>
</tr>
<tr>
<td>Jane</td>
<td>78xx56xx78</td>
<td>jane@gmail.com</td>
</tr>
</tbody>
</table>
There are different predefined table classes such as borderless, striped, highlighted, centered, and responsive tables. It plays an important role to make different type of tables. You can also make the Materialize table responsive easily by assigning the responsive-table
class to the <table>
element.