Bootstrap snippet and html example. Show Hide Columns using bootstrap table

Bootstrap 3.3.6 snippet "Show Hide Columns using bootstrap table" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.

HTML code

Clean, semantic HTML that powers this Bootstrap 3.3.6 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous" />

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="container">
    <div class="row">
        <div class="col-md-12">
<div class="table-responsive">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>#</th>
                        <th id="click-me">Click Me</th>
                        <th>Last Name</th>
                        <th>Username</th>
                        <th class="toggleDisplay">Th 1</th>
                        <th class="toggleDisplay">Th 2</th>
                        <th class="toggleDisplay">Th 3</th>
                        <th class="toggleDisplay">Th 4</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <th scope="row">1</th>
                        <td>Mark</td>
                        <td>Otto</td>
                        <td>@mdo</td>
                        <td class="toggleDisplay">Td 1</td>
                        <td class="toggleDisplay">Td 2</td>
                        <td class="toggleDisplay">Td 3</td>
                        <td class="toggleDisplay">Td 4</td>
                    </tr>
                    <tr>
                        <th scope="row">2</th>
                        <td>Jacob</td>
                        <td>Thornton</td>
                        <td>@fat</td>
                        <td class="toggleDisplay">Td 1</td>
                        <td class="toggleDisplay">Td 2</td>
                        <td class="toggleDisplay">Td 3</td>
                        <td class="toggleDisplay">Td 4</td>
                    </tr>
                    <tr>
                        <th scope="row">3</th>
                        <td>Larry</td>
                        <td>the Bird</td>
                        <td>@twitter</td>
                        <td class="toggleDisplay">Td 1</td>
                        <td class="toggleDisplay">Td 2</td>
                        <td class="toggleDisplay">Td 3</td>
                        <td class="toggleDisplay">Td 4</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
</div>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 3.3.6 to keep the design, spacing, and responsiveness consistent.

body{margin-top:20px;}

.toggleDisplay {
  display: none;
}
.toggleDisplay.in {
  display: table-cell;
}

Javascript/Jquery code

Lightweight JS to power any interactions this snippet needs. Drop it under your scripts (after Bootstrap 3.3.6) to mirror the live demo.

$("#click-me").click(function() {
    $(".table .toggleDisplay").toggleClass("in");
}); 

Similar snippets

Bootstrap example and template. Our latest projects

Our latest projects

Bootstrap example and template. unify colorful notifications

unify colorful notifications

Bootstrap example and template. bs4 account tickets

bs4 account tickets

Bootstrap example and template. Clean contact cards list

Clean contact cards list

Bootstrap example and template. payment credit card form

payment credit card form

Bootstrap example and template. Bootstrap 4 credit card payment form

Bootstrap 4 credit card payment form

Bootstrap example and template. Sign In and Sign Up Page

Sign In and Sign Up Page

Bootstrap example and template. event blocks

event blocks

FAQ

How do I use this snippet?

Include Bootstrap 3.3.6, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 3.3.6.

Bootstrap example and template. Show Hide Columns using bootstrap table

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 19.0K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 3.3.6

<link rel='stylesheet' href='https://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>

<script src='https://netdna.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script>

This code example is based on bootstrap 3.3.6 and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

Jquery plugins

Great built-in plugins with jquery framework, you can easy to change all declarations

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working