Bootstrap Tables

We can create different types of responsive and awesome bootstrap table like: striped , border etc.

Bootstrap Basic Table

We can create a basic bootstrap table by using its class .table. It has light padding and horizontal divider.

Example

<div class="container">  
  <h2>Striped Rows</h2>  
  <p>The .table-striped class adds zebra-stripes to a table:</p>              
  <table class="table table-striped">  
    <thead>  
      <tr>  
        <th>Product No</th>  
        <th>Product Names</th>  
        <th>Product Price</th>  
      </tr>  
    </thead>  
    <tbody>  
      <tr>  
        <td>1</td>  
        <td>TV</td>  
        <td>24,00</td>  
      </tr>  
      <tr>  
        <td>2</td>  
        <td>Radio</td>  
        <td>3000</td>  
      </tr>  
      <tr>  
        <td>3</td>  
        <td>Fan</td>  
        <td>9000</td>  
      </tr>  
    </tbody>  
  </table>  
</div>

Try Now

Bootstrap Border Table

We can create bootstrap border table by using its class .table-bordered.

Example: <table class="table table-bordered">

Bootstrap Striped Row Table

We can create bootstrap striped row table by using its class .zebra-stripes.

Example: <table class="table table-bordered">

Bootstrap Hover Rows Table

We can create bootstrap hover table by using its class .table –hover. When we will use it then the row will automatically selected.

Example: <table class="table table-hover">

Bootstrap Condensed Table

We can create a compact table by cutting cell padding in half, we have to use its class .table-condensed.

Example: <table class="table table-condensed">

Bootstrap Contextual classes:

In Bootstrap, Contextual classes are used to color the table row or table cells.

There are various contextual classes given below in the table.

Class Description
.active It is used to apply the hover color to the table row or table cell.
.success It is used to indicate a successful or positive action.
.info It is used to indicate a neutral informative change or action.
.warning It is used to specify a warning that might need attention.
.danger It is used to indicate a dangerous or potentially negative action.

Example:

<div class="container">  
  <h2>Striped Rows</h2>  
  <p>The Contextual classes can be used with: .active, .success, .info, .warning, and .danger.</p>  
  <table class="table">  
    <thead>  
<tr><th>Product No</th><th>Product Names</th><th>Product Price</th></tr>  
    </thead>  
    <tbody>  
<tr class="success"><td>1</td><td>TV</td><td>24,00</td></tr>  
<tr class="active"><td>2</td><td>Radio</td><td>3000</td></tr>  
<tr class="danger"><td>3</td><td>Fan</td><td>9000</td></tr>  
<tr class="warning"><td>4</td> <td>Cooler</td><td>7000</td></tr>  
    </tbody>  
  </table>  
</div>

Try Now

Bootstrap Responsive Tables

In Bootstrap, We can create responsive tables by using its class .tables-responsive. We can check the responsive table, by resizing it horizontally.

Example:

<div class="table-responsive">  
  <table class="table">  
    ...  
  </table>  
</div>

Related Topics

Bootstrap 4 Flex

Bootstrap 4 Flex Flex is a Bootstrap 4 component used to manage the layout, navigation bar, grid columns, sizing, alignment, and other components. The flexbox or flex utility is the replacement...

26 minutes read.

Bootstrap 4 Collapse

Bootstrap 4 Collapse Collapse is a bootstrap component that is similar to the dropdown button. Collapse is used to hide or show the content such as paragraphs, sentences, etc.  When we click on a...

4 minutes read.

Bootstrap Glyphicons

Bootstrap Glyphicon is used to create different type of glyphicons It is used in the web project. It provides 260 Glyphicons from the Glyphivons Halflings set. There are various examples of...

1 minute read.

Bootstrap 4 Tutorial

What is Bootstrap? Bootstrap is a CSS (Cascading Style Sheets) framework, which is used to develop a responsive website. It is an open-source and mobile-first front-end framework. It has design templates that are based...

4 minutes read.

Bootstrap 4 Grid System

Bootstrap 4 Grid System The bootstrap 4 grid system is used to create a responsive website layout. The bootstrap 4 offers a mobile-first flexbox grid system that allows you to divide...

4 minutes read.

Bootstrap 4 List Groups

Bootstrap 4 List Groups Bootstrap 4 offers List Group component, which is used to display a series of content in an organized way. The most common list group is an unordered...

13 minutes read.

Bootstrap 4 Filters

 Bootstrap 4 Filters Bootstrap 4 provides a filter component that is used to search an element from a list, table, etc. Bootstrap does not contain any component or utility that helps...

5 minutes read.

Bootstrap 4 Buttons

Bootstrap Buttons Bootstrap provides many custom button styles. These buttons are used in forms and dialog boxes for actions. Bootstrap offers various predefined classes for providing styles to buttons. There are many classes that are used...

7 minutes read.

Bootstrap Protocol (BOOTP)

In the following article, we will learn about the Bootstrap Protocol and how it maintains contracts among linked devices on webwork. What is Bootstrap Protocol? The Bootstrap Protocol is a webwork contract...

3 minutes read.

Bootstrap 4 Toast

Bootstrap 4 Toast Bootstrap 4 offers a Toast component, which is quite similar to the alert box and pushes notifications. The toast is visible on the screen for a few seconds when any...

5 minutes read.

Bootstrap Notification Bubble

What is a notification bubble? Bubbles are built into the Notification system. They float on top of the website or the button to indicate pending notifications. Bubbles can be expanded to reveal...

5 minutes read.

Bootstrap Validation Example

Validation We can provide valuable and actionable feedback to the users through an HTML form validation. It happens via custom styles or behaviors of default browsers and JavaScript. How does validation work...

4 minutes read.

Environment Setup

How to use Bootstrap? We can use bootstrap in our project either by downloading or by providing link of the library files. 1) Download Bootstrap files To download files, visit official site of bootstrap www.getbootstrap.com/download/ and...

1 minute read.

Bootstrap Searchable Dropdown Menu

Searchable Dropdown Menu When we click on the dropdown button/arrow in this dropdown menu, an input field will pop up with all the dropdown items listing inside. If we type in...

5 minutes read.

Bootstrap 4 Margin classes

Bootstrap 4 contains a variety of brief, responsive margin and padding utility classes to change the appearance of an element. The Bootstrap 4 margin classes use for the outer spacing of...

8 minutes read.

Difference between Bootstrap and WordPress

What is WordPress? WordPress is a free open-source CMS (Content Management System) that is written using Hypertext Pre-processor (PHP) and is paired with MySQL and is supported with HTTPS (Hypertext Transfer...

3 minutes read.

Bootstrap 4 Carousel

Bootstrap 4 Carousel Bootstrap 4 offers a carousel component, which is also known as a slider or slideshow. The carousel is used for the dynamic representation of content using images with...

7 minutes read.

Bootstrap Multiselect Dropdown

What is a multi-select Dropdown? Multi-select dropdown lists are used when we want to select multiple options for a particular record. Usually, dropdown lists provide the feature of choosing just one value...

4 minutes read.

Bootstrap List group

Bootstrap list group provides a group of a list of items. The most basic list is an unordered list. We can use <ul> element with .list-group class and <li> element with .lsit-group-item. Let us see...

3 minutes read.

Bootstrap 4 Scrollspy

Bootstrap 4 Scrollspy Bootstrap 4 offers a scrollspy component that is used to make the website more attractive and eye-catching. Basically, the scrollspy is used on the single-page website. The scrollspy highlights the nav...

5 minutes read.