Home >Web Front-end >CSS Tutorial >How to Set a Fixed Width for Elements in Bootstrap?
When working with table data (
For Bootstrap 4.0.0, the use of col-* classes for setting the width of
<tr> <th>
In Bootstrap 3.0, you can use the class "col-md-*" to assign a fixed width to the
<tr> <td class="col-md-2">A</td> <td class="col-md-3">B</td> <td class="col-md-6">C</td> <td class="col-md-1">D</td> </tr>
For Bootstrap 2.0, the class "span" serves the same purpose as "col-md-" in Bootstrap 3.0:
<tr> <td class="span2">A</td> <td class="span3">B</td> <td class="span6">C</td> <td class="span1">D</td> </tr>
It's important to note that if the
elements (table headers), the width should be specified on them rather than the | elements to ensure proper alignment. The above is the detailed content of How to Set a Fixed Width for Elements in Bootstrap?. For more information, please follow other related articles on the PHP Chinese website! Statement: The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn |
---|