Ask Your Question
4

How can Bootstrap tables have several rows and columns?

asked 2021-05-15 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-04-16 23:00:00 +0000

scrum gravatar image

Bootstrap tables can have several rows and columns by adding multiple HTML tags and elements within the <table> and <tr> tags. We can use the <th> tag for table header and <td> tag for table cell. The code below demonstrates how to create a basic Bootstrap table with multiple rows and columns:

<table class="table">
  <thead>
    <tr>
      <th>Header 1</th>
      <th>Header 2</th>
      <th>Header 3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Row 1, Column 1</td>
      <td>Row 1, Column 2</td>
      <td>Row 1, Column 3</td>
    </tr>
    <tr>
      <td>Row 2, Column 1</td>
      <td>Row 2, Column 2</td>
      <td>Row 2, Column 3</td>
    </tr>
    <!-- Add more rows as needed -->
  </tbody>
</table>

We can customize the table further using Bootstrap classes such as table-bordered for a bordered table, table-hover for adding hover effects, and table-striped for adding striped rows.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-05-15 11:00:00 +0000

Seen: 18 times

Last updated: Apr 16 '22