- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <title>Bootstrap 4 Display Table Classes</title>
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
- <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
- <style>
- .bs-example{
- margin: 20px;
- }
- .bs-example div{
- padding: 5px;
- border: 1px solid #dee2e6;
- border-collapse: collapse;
- }
- </style>
- </head>
- <body>
- <div class="bs-example">
- <h2>Display Table Classes</h2>
- <p>Use the d-table, d-table-row, and d-table-cell class to force an element to behave like a table, tr and td element, respectively. You can also add breakpoints (sm, md, lg, xl) to these classes (d-*-table, d-*-table-row and d-*-table-cell) to control when the element should behave like a table, row or column based on the screen width.</p>
- <div class="table d-table">
- <div class="d-table-row">
- <div class="d-table-cell">Cell 1</div>
- <div class="d-table-cell">Cell 2</div>
- </div>
- <div class="d-table-row">
- <div class="d-table-cell">Cell 3</div>
- <div class="d-table-cell">Cell 4</div>
- </div>
- </div>
- </div>
- </body>
- </html>