Bootstrap Table Example
| Name | Age | City |
|---|---|---|
| John Doe | 30 | New York |
| Jane Smith | 25 | Los Angeles |
| Bob Johnson | 40 | Chicago |
code this:
Sure! Below is an example of a simple HTML table using Bootstrap classes for styling. Make sure to include the Bootstrap CSS and JavaScript files in your HTML file for it to work properly.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bootstrap Table</title>
<!-- Include Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Bootstrap Table Example</h1>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>30</td>
<td>New York</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>25</td>
<td>Los Angeles</td>
</tr>
<tr>
<td>Bob Johnson</td>
<td>40</td>
<td>Chicago</td>
</tr>
</tbody>
</table>
</div>
<!-- Include Bootstrap JavaScript (optional for some features) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>
```
In this example, we've used Bootstrap classes such as `table`, `table-bordered`, and `table-striped` to create a simple table with three columns: Name, Age, and City. The `table-bordered` class adds borders around each cell, and the `table-striped` class adds alternating background colors to rows, making it easier to read.