mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-21 20:55:50 +02:00
tables.md: make vertical table responsive (#30191)
Fixes page overflow on mobile. Co-authored-by: Martijn Cuppens <martijn.cuppens@gmail.com>
This commit is contained in:
@@ -401,36 +401,38 @@ Add `.table-sm` to make any `.table` more compact by cutting all cell `padding`
|
|||||||
Table cells of `<thead>` are always vertical aligned to the bottom. Table cells in `<tbody>` inherit their alignment from `<table>` and are aligned to the the top by default.
|
Table cells of `<thead>` are always vertical aligned to the bottom. Table cells in `<tbody>` inherit their alignment from `<table>` and are aligned to the the top by default.
|
||||||
|
|
||||||
{{< example >}}
|
{{< example >}}
|
||||||
<table class="table align-middle">
|
<div class="table-responsive">
|
||||||
<thead>
|
<table class="table align-middle">
|
||||||
<tr>
|
<thead>
|
||||||
<th scope="col" class="w-25">Heading 1</th>
|
<tr>
|
||||||
<th scope="col" class="w-25">Heading 2</th>
|
<th scope="col" class="w-25">Heading 1</th>
|
||||||
<th scope="col" class="w-25">Heading 2</th>
|
<th scope="col" class="w-25">Heading 2</th>
|
||||||
<th scope="col" class="w-25">Heading 4</th>
|
<th scope="col" class="w-25">Heading 2</th>
|
||||||
</tr>
|
<th scope="col" class="w-25">Heading 4</th>
|
||||||
</thead>
|
</tr>
|
||||||
<tbody>
|
</thead>
|
||||||
<tr>
|
<tbody>
|
||||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
<tr>
|
||||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||||
<td>Nulla vitae elit libero, a pharetra augue. Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper.</td>
|
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||||
</tr>
|
<td>Nulla vitae elit libero, a pharetra augue. Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper.</td>
|
||||||
<tr class="align-bottom">
|
</tr>
|
||||||
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
<tr class="align-bottom">
|
||||||
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
||||||
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
||||||
<td>Nulla vitae elit libero, a pharetra augue. Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper.</td>
|
<td>This cell inherits <code>vertical-align: bottom;</code> from the table row</td>
|
||||||
</tr>
|
<td>Nulla vitae elit libero, a pharetra augue. Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper.</td>
|
||||||
<tr>
|
</tr>
|
||||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
<tr>
|
||||||
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||||
<td class="align-top">This cell is aligned to the top.</td>
|
<td>This cell inherits <code>vertical-align: middle;</code> from the table</td>
|
||||||
<td>Nulla vitae elit libero, a pharetra augue. Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper.</td>
|
<td class="align-top">This cell is aligned to the top.</td>
|
||||||
</tr>
|
<td>Nulla vitae elit libero, a pharetra augue. Cras mattis consectetur purus sit amet fermentum. Vestibulum id ligula porta felis euismod semper.</td>
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
{{< /example >}}
|
{{< /example >}}
|
||||||
|
|
||||||
### Variants
|
### Variants
|
||||||
|
Reference in New Issue
Block a user