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 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 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 First Example

1) Add HTML5 doctype Before starting the example of Bootstrap, we should know about the some basic rules of Bootstrap. We have to add HTML5 doctype with lang element and CSS properties. <!DOCTYPE html>   <html lang="en">     <head>       <meta charset="utf-8">      </head>   </html> 2) Bootstrap...

2 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 4 Media Objects

Bootstrap 4 Media Objects Bootstrap 4 offers a media object component that aligns the media objects and the content. The media object is used to create a repetitive and complex component...

7 minutes read.

Bootstrap Badges and Labels

Bootstrap Badges Bootstrap Badges are numerical indicators. It is used to show that how many items are associated with a link.The .badge class is used to create of Bootstrap Badges. Let us see...

2 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.

Bootstrap 4 Card

In Bootstrap 4, a card is a bordered box with padding around its content. It has options for headers, footers, colors, content, etc. The card provides the link, title, image,...

8 minutes read.

Bootstrap 4 Form

Bootstrap 4 Forms Bootstrap 4 provides forms, which are one of the essential components for web pages and web applications. It is an input-based component, used to collect user data with the help of...

8 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 Wells

In Bootstrap, well are used to add a rounded border around an element. It is default some padding and gray background color. It is like a container that displays the content....

1 minute read.

Bootstrap Input groups

Bootstrap 4 Input groups The input group is a component of Bootstrap 4, which is used to create interactive and stylish form controls. With the help of input groups, you can easily customize the input...

8 minutes read.

Bootstrap 4 Pagination

Bootstrap 4 Pagination Bootstrap pagination is used to show the existence of a series of web pages of the website. It allows navigation on multiple pages of a website. In pagination, there is a block...

9 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 With CSS

← Prev Next → ...

1 minute 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.

CakePHP Layouts & Elements

A layout includes a presentation code that can be wrapped out in your view. It means that what you want to see in your view should be well-positioned in layout. When you create...

9 minutes read.

Bootstrap 4 Content

Typography Typography is used for styling and formatting the content. It also helps in creating customized headings, sub-headings, lists, paragraphs, etc. Headings Bootstrap 4 offers HTML heading <h1> to <h6> that has bolder...

8 minutes read.

Bootstrap Tabs and Pills

Bootstrap Menus Bootstrap menu is used to create different types of menu. It can created horizontal with its .list-inlineclass. <div class="container">       <h3>Example of Bootstrap Menu</h3>       <ul class="list-inline">         <li><a href="#">Home</a></li>         <li><a href="#">About</a></li>         <li><a href="#">Contact</a></li>         <li><a href="#">services</a></li>       </ul>     </div> Try Now Bootstrap Tabs Bootstrap tabl is look like is menu but there is some difference....

4 minutes read.

Bootstrap 4 Spinners

Bootstrap 4 offers spinner is a loading indicator that is used to display the loading state of any component or web page. The spinner is also known as a loader...

7 minutes read.