What is a Condensed Table in Bootstrap?

Web Development Bootstrap in Web Development 3 years ago

  1   0   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

To condense a table means to cut the row padding in half to shrink it.

Here’s how you make a table condensed:

<table CLASS="table table-condensed"> … </table>

A regular table with border looks like this:

However, a table with bordered and condensed class looks like this. You can easily spot the difference in padding i.e. the following table itself looks condensed:

The below example displays how we can create a condensed table:

<!DOCTYPE HTML> <html lang="en"> <head>   <TITLE>BOOTSTRAP Condensed Table</title>   <meta charset="utf-8">   <meta name="viewport" content="width=device-width, initial-scale=1">   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container">   <h2>Rank</h2>   <p>Rank of teams in Test Cricket</p>               <table class="table table-bordered table-condensed">     <thead>       <tr>         <th>Team</th>         <th>Rank</th>       </tr>     </thead>     <tbody>       <tr>         <td>India</td>         <td>1</td>       </tr>       <tr>         <td>England</td>         <td>2</td>       </tr>       <tr>         <td>Australia</td>         <td>3</td>       </tr>       <tr>         <td>SOUTH Africa</td>         <td>4</td>       </tr>       <tr>         <td>Srilanka</td>         <td>5</td>       </tr>     </tbody>   </table> </div> </body> </html>

The condensed table as our output looks like this:

Posted on 31 May 2022, this text provides information on Web Development related to Bootstrap in Web Development. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Tuteehub forum answer Answers

Post Answer

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.