Table responsive

React Bootstrap 5 Table responsive component

React Responsive Table built with Bootstrap 5 allow tables to be scrolled horizontally with ease. They can be comfortably used both on desktops and mobile devices.

To learn more read Docs.


Responsive tables

Responsive tables allow tables to be scrolled horizontally with ease. Make any table responsive across all viewports by wrapping a .table with .table-responsive. Or, pick a maximum breakpoint with which to have a responsive table up to by using .table-responsive{-sm|-md|-lg|-xl|-xxl}.

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.

Always responsive

Across every breakpoint, use .table-responsive for horizontally scrolling tables.

# 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
        
            
            import React from 'react';
            import { MDBTable, MDBTableHead, MDBTableBody } from 'mdb-react-ui-kit';
    
            export default function App() {
              return (
                <MDBTable responsive>
                  <MDBTableHead>
                    <tr>
                      <th scope='col'>#</th>
                      <th scope='col'>Heading</th>
                      <th scope='col'>Heading</th>
                      <th scope='col'>Heading</th>
                      <th scope='col'>Heading</th>
                      <th scope='col'>Heading</th>
                      <th scope='col'>Heading</th>
                      <th scope='col'>Heading</th>
                      <th scope='col'>Heading</th>
                      <th scope='col'>Heading</th>
                    </tr>
                  </MDBTableHead>
                  <MDBTableBody>
                    <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>
                  </MDBTableBody>
                </MDBTable>
              );
            }
          
        
    

Breakpoint specific

Use .table-responsive{-sm|-md|-lg|-xl|-xxl} as needed to create responsive tables up to a particular breakpoint. From that breakpoint and up, the table will behave normally and not scroll horizontally.

These tables may appear broken until their responsive styles apply at specific viewport widths.

# Heading Heading Heading Heading Heading Heading Heading Heading
1 Cell Cell Cell Cell Cell Cell Cell Cell
2 Cell Cell Cell Cell Cell Cell Cell Cell
3 Cell Cell Cell Cell Cell Cell Cell Cell
# Heading Heading Heading Heading Heading Heading Heading Heading
1 Cell Cell Cell Cell Cell Cell Cell Cell
2 Cell Cell Cell Cell Cell Cell Cell Cell
3 Cell Cell Cell Cell Cell Cell Cell Cell
# Heading Heading Heading Heading Heading Heading Heading Heading
1 Cell Cell Cell Cell Cell Cell Cell Cell
2 Cell Cell Cell Cell Cell Cell Cell Cell
3 Cell Cell Cell Cell Cell Cell Cell Cell
# Heading Heading Heading Heading Heading Heading Heading Heading
1 Cell Cell Cell Cell Cell Cell Cell Cell
2 Cell Cell Cell Cell Cell Cell Cell Cell
3 Cell Cell Cell Cell Cell Cell Cell Cell
# Heading Heading Heading Heading Heading Heading Heading Heading
1 Cell Cell Cell Cell Cell Cell Cell Cell
2 Cell Cell Cell Cell Cell Cell Cell Cell
3 Cell Cell Cell Cell Cell Cell Cell Cell
# Heading Heading Heading Heading Heading Heading Heading Heading
1 Cell Cell Cell Cell Cell Cell Cell Cell
2 Cell Cell Cell Cell Cell Cell Cell Cell
3 Cell Cell Cell Cell Cell Cell Cell Cell
        
            
          import React from 'react';
          import { MDBTable, MDBTableHead, MDBTableBody } from 'mdb-react-ui-kit';
  
          export default function App() {
            return (
              <>
                <section className='border p-4 text-center mb-4'>
                  <MDBTable responsive>
                    <MDBTableHead>
                      <tr>
                        <th scope='col'>#</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                      </tr>
                    </MDBTableHead>
                    <MDBTableBody>
                      <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>
                      </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>
                      </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>
                      </tr>
                    </MDBTableBody>
                  </MDBTable>
                </section>
    
                <section className='border p-4 text-center mb-4'>
                  <MDBTable responsive='sm'>
                    <MDBTableHead>
                      <tr>
                        <th scope='col'>#</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                      </tr>
                    </MDBTableHead>
                    <MDBTableBody>
                      <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>
                      </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>
                      </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>
                      </tr>
                    </MDBTableBody>
                  </MDBTable>
                </section>
    
                <section className='border p-4 text-center mb-4'>
                  <MDBTable responsive='md'>
                    <MDBTableHead>
                      <tr>
                        <th scope='col'>#</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                      </tr>
                    </MDBTableHead>
                    <MDBTableBody>
                      <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>
                      </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>
                      </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>
                      </tr>
                    </MDBTableBody>
                  </MDBTable>
                </section>
    
                <section className='border p-4 text-center mb-4'>
                  <MDBTable responsive='lg'>
                    <MDBTableHead>
                      <tr>
                        <th scope='col'>#</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                      </tr>
                    </MDBTableHead>
                    <MDBTableBody>
                      <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>
                      </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>
                      </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>
                      </tr>
                    </MDBTableBody>
                  </MDBTable>
                </section>
    
                <section className='border p-4 text-center mb-4'>
                  <MDBTable responsive='xl'>
                    <MDBTableHead>
                      <tr>
                        <th scope='col'>#</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                      </tr>
                    </MDBTableHead>
                    <MDBTableBody>
                      <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>
                      </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>
                      </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>
                      </tr>
                    </MDBTableBody>
                  </MDBTable>
                </section>
    
                <section className='border p-4 text-center mb-4'>
                  <MDBTable responsive='xxl'>
                    <MDBTableHead>
                      <tr>
                        <th scope='col'>#</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                        <th scope='col'>Heading</th>
                      </tr>
                    </MDBTableHead>
                    <MDBTableBody>
                      <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>
                      </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>
                      </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>
                      </tr>
                    </MDBTableBody>
                  </MDBTable>
                </section>
              </>
            );
          }