How to useBootstrap Table in Bootstrap
In this approach, we are using the Bootstrap classes like ‘table‘, ‘table-responsive‘, ‘row‘, and ‘col‘ to create the layout. This approach assures that the equal-height column by applying the normal behavior with the table elements. This approach uses Bootstrap Table classes to maintain equal heights without the need for additional CSS rules.
Example: This example uses the Bootstrap Table approach to create an equal-height column.
HTML
<!DOCTYPE html> < html lang = "en" > < head > < meta charset = "UTF-8" > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > < link rel = "stylesheet" href = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" > < title >Equal Height Columns with Bootstrap Table Approach</ title > </ head > < body > < div class = "container mt-5" > < div class = "text-center" > < h1 class = "geeks-heading text-success" > w3wiki </ h1 > < h3 class = "approach-heading" > Approach 3: Using Bootstrap Table </ h3 > </ div > < div class = "table equal-height-row" > < div class = "row" > < div class = "col equal-height-col bg-primary" > < h2 >Column 1</ h2 > < p >This is some sample content for column 1.</ p > </ div > < div class = "col equal-height-col bg-success" > < h2 >Column 2</ h2 > < p > This is some sample content for column 2. </ p > </ div > < div class = "col equal-height-col bg-warning" > < h2 >Column 3</ h2 > < p > This is some sample content for column 3. </ p > </ div > < div class = "col equal-height-col bg-info" > < h2 >Column 4</ h2 > < p > This is some sample content for column 4. </ p > </ div > < div class = "col equal-height-col bg-danger" > < h2 >Column 5</ h2 > < p > This is some sample content for column 5. </ p > </ div > </ div > </ div > </ div > </ body > </ html > |
Output:
How to Create Equal Height Columns in Bootstrap ?
This article will demonstrate how to create equal-height columns in Bootstrap. We will use different approaches to achieve equal heights using the bootstrap classes and methods.
Table of Content
- Using Bootstrap and Flexbox
- Using Bootstrap Grids
- Using Bootstrap Table