Table

Vue Bootstrap table / material design table

Tables let you aggregate a huge amount of data and present it in the clear and orderly way.

Vue tables provide additional benefits like responsiveness and the possibility of manipulating the styles of the tables.

You can enhance your tables by adding buttons, checkboxes, panels, and many other additional elements.

You can also use an advanced datatables options like sort, search or pagination.


If you want to use basic bootstrap tables have a look at the documentation below.

For more advanced options go to the specific documentation pages listed below:


Basic table

Using the most basic table markup, here’s how .table-based tables look in Bootstrap. All table styles are inherited in Bootstrap 4, meaning any nested tables will be styled in the same manner as the parent.

# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

        <template>
          <div>
            <tbl>
              <tbl-head>
                <tr>
                  <th>#</th>
                  <th>First</th>
                  <th>Last</th>
                  <th>Handle</th>
                </tr>
              </tbl-head>
              <tbl-body>
                <tr>
                  <th>1</th>
                  <td>Mark</td>
                  <td>Otto</td>
                  <td>@mdo</td>
                </tr>
                <tr>
                  <th>2</th>
                  <td>Jacob</td>
                  <td>Thornton</td>
                  <td>@fat</td>
                </tr>
                <tr>
                  <th>3</th>
                  <td>Larry</td>
                  <td>the Bird</td>
                  <td>@twitter</td>
                </tr>
              </tbl-body>
            </tbl>
          </div>
        </template>
        <script>
          import { Tbl, TblHead, TblBody } from 'mdbvue';
          
          export default {
            name: 'TablePage',
            components: {
              Tbl,
              TblHead,
              TblBody
            }
          };
        </script>
        
        <!-- Add "scoped" attribute to limit CSS to this component only -->
        <style scoped>
        
        </style>
      

Table head options

To change a background-color of <tbl-head> (or any other element) use our color classes names in property color. . If you are going to use a dark background you should also consider white text (to provide a proper contrast) by adding textWhite property.

# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

        <template>
            <div>
              <tbl>
                <tbl-head color="black" textWhite>
                  <tr>
                    <th>#</th>
                    <th>First</th>
                    <th>Last</th>
                    <th>Handle</th>
                  </tr>
                </tbl-head>
                <tbl-body>
                  <tr>
                    <th>1</th>
                    <td>Mark</td>
                    <td>Otto</td>
                    <td>@mdo</td>
                  </tr>
                  <tr>
                    <th>2</th>
                    <td>Jacob</td>
                    <td>Thornton</td>
                    <td>@fat</td>
                  </tr>
                  <tr>
                    <th>3</th>
                    <td>Larry</td>
                    <td>the Bird</td>
                    <td>@twitter</td>
                  </tr>
                </tbl-body>
              </tbl>

              <tbl>
                <tbl-head color="grey">
                  <tr>
                    <th>#</th>
                    <th>First</th>
                    <th>Last</th>
                    <th>Handle</th>
                  </tr>
                </tbl-head>
                <tbl-body>
                  <tr>
                    <th>1</th>
                    <td>Mark</td>
                    <td>Otto</td>
                    <td>@mdo</td>
                  </tr>
                  <tr>
                    <th>2</th>
                    <td>Jacob</td>
                    <td>Thornton</td>
                    <td>@fat</td>
                  </tr>
                  <tr>
                    <th>3</th>
                    <td>Larry</td>
                    <td>the Bird</td>
                    <td>@twitter</td>
                  </tr>
                </tbl-body>
              </tbl>
            </div>
          </template>
          <script>
            import { Tbl, TblHead, TblBody } from 'mdbvue';
            
            export default {
              name: 'TablePage',
              components: {
                Tbl,
                TblHead,
                TblBody
              }
            };
          </script>
          
          <!-- Add "scoped" attribute to limit CSS to this component only -->
          <style scoped>
          
          </style>
      

Striped rows

Use prop striped to add zebra-striping to any table row within the <tbl-body>.

# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

        <template>
            <div>
              <tbl striped>
                <tbl-head>
                  <tr>
                    <th>#</th>
                    <th>First</th>
                    <th>Last</th>
                    <th>Handle</th>
                  </tr>
                </tbl-head>
                <tbl-body>
                  <tr>
                    <th>1</th>
                    <td>Mark</td>
                    <td>Otto</td>
                    <td>@mdo</td>
                  </tr>
                  <tr>
                    <th>2</th>
                    <td>Jacob</td>
                    <td>Thornton</td>
                    <td>@fat</td>
                  </tr>
                  <tr>
                    <th>3</th>
                    <td>Larry</td>
                    <td>the Bird</td>
                    <td>@twitter</td>
                  </tr>
                </tbl-body>
              </tbl>
            </div>
          </template>
          <script>
            import { Tbl, TblHead, TblBody } from 'mdbvue';
            
            export default {
              name: 'TablePage',
              components: {
                Tbl,
                TblHead,
                TblBody
              }
            };
          </script>
          
          <!-- Add "scoped" attribute to limit CSS to this component only -->
          <style scoped>
          
          </style>
        

Bordered table

Add prop bordered for borders on all sides of the table and cells.

# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

        <template>
          <div>
            <tbl bordered>
              <tbl-head>
                <tr>
                  <th>#</th>
                  <th>First</th>
                  <th>Last</th>
                  <th>Handle</th>
                </tr>
              </tbl-head>
              <tbl-body>
                <tr>
                  <th>1</th>
                  <td>Mark</td>
                  <td>Otto</td>
                  <td>@mdo</td>
                </tr>
                <tr>
                  <th>2</th>
                  <td>Jacob</td>
                  <td>Thornton</td>
                  <td>@fat</td>
                </tr>
                <tr>
                  <th>3</th>
                  <td colspan="2">Larry the Bird</td>
                  <td>@twitter</td>
                </tr>
              </tbl-body>
            </tbl>
          </div>
        </template>
        <script>
          import { Tbl, TblHead, TblBody } from 'mdbvue';
          
          export default {
            name: 'TablePage',
            components: {
              Tbl,
              TblHead,
              TblBody
            }
          };
        </script>
        
        <!-- Add "scoped" attribute to limit CSS to this component only -->
        <style scoped>
        
        </style>
      

Borderless table

Add prop borderless for a table without borders.

# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

        <template>
          <div>
            <tbl borderless>
              <tbl-head>
                <tr>
                  <th>#</th>
                  <th>First</th>
                  <th>Last</th>
                  <th>Handle</th>
                </tr>
              </tbl-head>
              <tbl-body>
                <tr>
                  <th>1</th>
                  <td>Mark</td>
                  <td>Otto</td>
                  <td>@mdo</td>
                </tr>
                <tr>
                  <th>2</th>
                  <td>Jacob</td>
                  <td>Thornton</td>
                  <td>@fat</td>
                </tr>
                <tr>
                  <th>3</th>
                  <td colspan="2">Larry the Bird</td>
                  <td>@twitter</td>
                </tr>
              </tbl-body>
            </tbl>
          </div>
        </template>
        <script>
          import { Tbl, TblHead, TblBody } from 'mdbvue';
          
          export default {
            name: 'TablePage',
            components: {
              Tbl,
              TblHead,
              TblBody
            }
          };
        </script>
        
        <!-- Add "scoped" attribute to limit CSS to this component only -->
        <style scoped>
        
        </style>
      

Hoverable rows

Add prop hover to enable a hover state on table rows.

# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

        <template>
          <div>
            <tbl hover>
              <tbl-head>
                <tr>
                  <th>#</th>
                  <th>First</th>
                  <th>Last</th>
                  <th>Handle</th>
                </tr>
              </tbl-head>
              <tbl-body>
                <tr>
                  <th>1</th>
                  <td>Mark</td>
                  <td>Otto</td>
                  <td>@mdo</td>
                </tr>
                <tr>
                  <th>2</th>
                  <td>Jacob</td>
                  <td>Thornton</td>
                  <td>@fat</td>
                </tr>
                <tr>
                  <th>3</th>
                  <td colspan="2">Larry the Bird</td>
                  <td>@twitter</td>
                </tr>
              </tbl-body>
            </tbl>
          </div>
        </template>
        <script>
          import { Tbl, TblHead, TblBody } from 'mdbvue';
          
          export default {
            name: 'TablePage',
            components: {
              Tbl,
              TblHead,
              TblBody
            }
          };
        </script>
        
        <!-- Add "scoped" attribute to limit CSS to this component only -->
        <style scoped>
        
        </style>
      

Small table

Add prop sm to make tables more compact by cutting cell padding in half.

# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

        <template>
          <div>
            <tbl sm>
              <tbl-head>
                <tr>
                  <th>#</th>
                  <th>First</th>
                  <th>Last</th>
                  <th>Handle</th>
                </tr>
              </tbl-head>
              <tbl-body>
                <tr>
                  <th>1</th>
                  <td>Mark</td>
                  <td>Otto</td>
                  <td>@mdo</td>
                </tr>
                <tr>
                  <th>2</th>
                  <td>Jacob</td>
                  <td>Thornton</td>
                  <td>@fat</td>
                </tr>
                <tr>
                  <th>3</th>
                  <td colspan="2">Larry the Bird</td>
                  <td>@twitter</td>
                </tr>
              </tbl-body>
            </tbl>
          </div>
        </template>
        <script>
          import { Tbl, TblHead, TblBody } from 'mdbvue';
          
          export default {
            name: 'TablePage',
            components: {
              Tbl,
              TblHead,
              TblBody
            }
          };
        </script>
        
        <!-- Add "scoped" attribute to limit CSS to this component only -->
        <style scoped>
        
        </style>
      

Captions

caption functions like a heading for a table. It helps users with screen readers to find a table and understand what it’s about and decide if they want to read it.

List of users
# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter

        <template>
          <div>
            <tbl>
              <caption>List of users</caption>
              <tbl-head>
                <tr>
                  <th>#</th>
                  <th>First</th>
                  <th>Last</th>
                  <th>Handle</th>
                </tr>
              </tbl-head>
              <tbl-body>
                <tr>
                  <th>1</th>
                  <td>Mark</td>
                  <td>Otto</td>
                  <td>@mdo</td>
                </tr>
                <tr>
                  <th>2</th>
                  <td>Jacob</td>
                  <td>Thornton</td>
                  <td>@fat</td>
                </tr>
                <tr>
                  <th>3</th>
                  <td>Larry</td>
                  <td>the Bird</td>
                  <td>@twitter</td>
                </tr>
              </tbl-body>
            </tbl>
          </div>
        </template>
        <script>
          import { Tbl, TblHead, TblBody } from 'mdbvue';
          
          export default {
            name: 'TablePage',
            components: {
              Tbl,
              TblHead,
              TblBody
            }
          };
        </script>
        
        <!-- Add "scoped" attribute to limit CSS to this component only -->
        <style scoped>
        
        </style>
      

Responsive table

Create responsive table by adding prop 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.

Vertical clipping/truncation

Responsive tables make use of overflow-y: hidden, which clips off any content that goes beyond the bottom or top edges of the table. In particular, this can clip off dropdown menus and other third-party widgets.

Note: For more advanced options of responsive tables have a look at Responsive Tables documentation .

# Heading Heading Heading Heading Heading Heading Heading Heading Heading
1 Cell Cell Cell Cell Cell Cell Cell Cell Cell
2 Cell Cell Cell Cell Cell Cell Cell Cell Cell
3 Cell Cell Cell Cell Cell Cell Cell Cell Cell

        <template>
          <div>
            <tbl responsive>
              <tbl-head>
                <tr>
                  <th>#</th>
                  <th>Heading</th>
                  <th>Heading</th>
                  <th>Heading</th>
                  <th>Heading</th>
                  <th>Heading</th>
                  <th>Heading</th>
                  <th>Heading</th>
                  <th>Heading</th>
                  <th>Heading</th>
                </tr>
              </tbl-head>
              <tbl-body>
                <tr>
                  <th scope="row">1</th>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                </tr>
                <tr>
                  <th scope="row">2</th>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                </tr>
                <tr>
                  <th scope="row">3</th>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                  <td>Cell</td>
                </tr>
              </tbl-body>
            </tbl>
          </div>
        </template>
        <script>
          import { Tbl, TblHead, TblBody } from 'mdbvue';
          
          export default {
            name: 'TablePage',
            components: {
              Tbl,
              TblHead,
              TblBody
            }
          };
        </script>
        
        <!-- Add "scoped" attribute to limit CSS to this component only -->
        <style scoped>
        
        </style>
      

Advanced table options

For advanced options of the tables have a look at specific documentation pages listed below.

Table sort

This functionality lets you sort the data of the tables according to any specific columns.

Table scroll

If your table is too long or too wide you can limit its size and enable scroll functionality.

Table editable

Table editable allows you to edit existing data within the table and add new data to the table.

Tables - getting started : download & setup


Download

All the components and features are part of MDBootstrap for Vue package.

MDBootstrap (Material Design for Bootstrap) is a free (MIT Licensed) framework combining Material Design and the newest Bootstrap 4 with Vue.

Click the button below to go to Download Page, where you can download MDBootstrap package.

MDBootstrap Vue version Download MDBootstrap (Vue version) About

MDB Pro

Using components and features labeled as MDB Pro component requires MDB Pro package.

Click the button below to learn more about MDBbootstrap Pro package

MDBootstrap Pro

Tutorials

If you need additional help to start, use our "5 min Quick Start".

5 min Quick Start

Compilation

To reduce a weight of MDBootstrap package, you can compile your own, custom package containing only components and features you need.


      // Required SCSS files:

      /scss/free/_tables.scss
  

Compilation & Customization tutorial

If you need additional help to compile your custom package, use our Compilation & Customization tutorial

Compilation & Customization tutorial