Bulma Table Variables

Last Updated : 23 Jul, 2025

Bulma is a free and open-source CSS framework based on Flexbox. It is component rich, compatible, and well documented. It is highly responsive in nature. It uses classes to implement its design. 

Bulma supports a lot of types of tables like a bordered table, stripped table, hoverable table, scrollable table, etc. Just by adding some Bulma classes to the HTML, we can achieve very interactive tables.

 Syntax to use variables:

$property-name: Property-value;

Variable Used:

NameDescription       TypeValueComputed ValueComputed Type
$table-colorThis property is used to provide color to the table.variable$text-stronghsl(0, 0%, 21%)color
$table-background-colorThis property is used to provide background color to the table.variable$scheme-mainhsl(0, 0%, 100%)color
$table-cell-borderThis property is used to provide a border cell to the table.size1px solid $border  
$table-cell-border-widthThis property is used to define the border width of the table.size0 0 1px  
$table-cell-paddingThis property is used to define the padding of the cell in the table.size0.5em 0.75em  
$table-cell-heading-colorThis property is used to provide color to the heading cell of the table.variable$text-stronghsl(0, 0%, 21%)color
$table-cell-text-alignThis property is used to align text into the center of the cell in the table.stringleft  
$table-head-cell-border-width This property is used to define the width of the head cell border.size0 0 2px  
$table-head-cell-colorThis property is used to define the color of the head cell of the table.variable$text-stronghsl(0, 0%, 21%)color
$table-foot-cell-border-widthThis property is used to define the width of the foot cell in the table.size2px 0 0  
$table-foot-cell-colorThis property is used to define the color of the foot of the cell.variable$text-stronghsl(0, 0%, 21%)color
$table-head-background-colorThis property is used to provide the background color of the head of the table.stringtransparent  
$table-body-background-colorThis property is used to provide the background color of the body.stringtransparent  
$table-foot-background-color This property is used to provide background color to the foot table.stringtransparent  
$table-row-hover-background-colorThis property is used to provide background color to the row table on hover.variable$scheme-main-bishsl(0, 0%, 98%)color
$table-row-active-background-colorThis property is used to provide background color to the active row.variable$primaryhsl(171, 100%, 41%)color
$table-row-active-colorThis property is used to provide color to the active row of the table.variable$primary-invert#fffcolor
$table-striped-row-even-background-colorThis property is used to provide background color to the even row.variable$scheme-main-bishsl(0, 0%, 98%)color
$table-striped-row-even-hover-background-colorThis property is used to provide background color to the even rows on hover.variable$scheme-main-terhsl(0, 0%, 96%)color
$table-colorsThis property is used to provide color to the table.variable$colorsBulma colorsmap

Example 1: In the below code, we will make use of the above variable to demonstrate the use of the table.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Bulma Variable</title>
    <link rel='stylesheet' href=
'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>

    <!-- font-awesome cdn -->
    <script src=
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/js/all.min.js'>
    </script>
    <link rel="stylesheet" href="style.css">
    <style>
        .title{
            color:green;
        }
        nav{
            margin-left:200px;
            margin-right:200px;
        }
    </style>
</head>

<body>
    <h1 class="title has-text-centered">
        GeekforGeeks
    </h1>
    <h3 class="subtitle has-text-centered">
            A computer science portal for geeks.
    </h3><br>

    <div class='container has-text-centered'>
        <div class='columns is-mobile is-centered'>
            <div class='column is-8'>
                <div>
                  <h1 class='title'>User Information</h1>
                  <hr>
                </div>
                <table class='table'>
                    <thead>
                        <tr>
                          <th>Username</th>
                          <th>Email</th>
                          <th>Gender</th>
                          <th>Address</th>
                          <th>Phone No.</th>
                        </tr>
                     </thead>
                    <tbody>
                        <tr>
                          <td>vinod34</td>
                          <td>vilod565@gmail.com</td>
                          <td>Male</td>
                          <td>West Bengal</td>
                          <td>9856777809</td>
                        </tr>
             
                        <tr>
                          <td>deepak13</td>
                          <td>deepak13@gmail.com</td>
                          <td>Male</td>
                          <td>Mumbai</td>
                          <td>6556455521</td>
                        </tr>
         
                        <tr>
                          <td>sneha345</td>
                          <td>sneha345@gmail.com</td>
                          <td>Female</td>
                          <td>Dadar</td>
                          <td>7674544434</td>
                        </tr>
             
                        <tr>
                          <td>saimi875</td>
                          <td>saimi875@gmail.com</td>
                          <td>Male</td>
                          <td>Borivali</td>
                          <td>8767543452</td>
                        </tr>
         
                        <tr>
                          <td>santra765</td>
                          <td>santra765@gmail.com</td>
                          <td>Female</td>
                          <td>Dahisar</td>
                          <td>9567345237</td>
                        </tr>    
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</body>
</html>

SCSS Code:

$table-colors:lightgreen;
.table{
   color:$table-colors;
}

Compiled CSS Code:

.table {
 color: lightgreen; }

Output:

 

Example 2: In the below code, we will make use of the above variable to demonstrate the use of the table.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Bulma Variable</title>
    <link rel='stylesheet' href=
    'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>

    <!-- font-awesome cdn -->
    <script src=
    'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/js/all.min.js'>
    </script>
    <link rel="stylesheet" href="style.css">

    <style>
        .title{
            color:green;
        }
        nav{
            margin-left:200px;
            margin-right:200px;
        }
    </style>
</head>

<body>
    <h1 class="title has-text-centered">
        GeekforGeeks
    </h1>
    <h3 class="subtitle has-text-centered">
        A computer science portal for geeks.
    </h3><br>

    <div class='container has-text-centered'>
        <div class='columns is-mobile is-centered'>
            <div class='column is-8'>
                <div>
                  <h1 class='title'>User Information</h1>
                  <hr>
                </div>
                <table class='table'>
                    <thead>
                        <tr>
                          <th>Username</th>
                          <th>Email</th>
                          <th>Gender</th>
                          <th>Address</th>
                          <th>Phone No.</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                          <td>vinod34</td>
                          <td>vilod565@gmail.com</td>
                          <td>Male</td>
                          <td>West Bengal</td>
                          <td>9856777809</td>
                        </tr>
             
                        <tr>
                          <td>deepak13</td>
                          <td>deepak13@gmail.com</td>
                          <td>Male</td>
                          <td>Mumbai</td>
                          <td>6556455521</td>
                        </tr>
         
                        <tr>
                          <td>sneha345</td>
                          <td>sneha345@gmail.com</td>
                          <td>Female</td>
                          <td>Dadar</td>
                          <td>7674544434</td>
                        </tr>
             
                        <tr>
                          <td>saimi875</td>
                          <td>saimi875@gmail.com</td>
                          <td>Male</td>
                          <td>Borivali</td>
                          <td>8767543452</td>
                        </tr>
         
                        <tr>
                          <td>santra765</td>
                          <td>santra765@gmail.com</td>
                          <td>Female</td>
                          <td>Dahisar</td>
                          <td>9567345237</td>
                        </tr>    
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</body>
</html>

SCSS Code:

$table-background-color:lightgreen;
.table{
   background-color:$table-background-color;
 }

Compiled CSS Code:

.table {
   background-color: lightgreen;
 }

Output:

 

Reference: https://bulma.io/documentation/elements/table/#variables

Comment