How to Align Text in Bootstrap Tables?

Susan Sarandon
Release: 2024-10-30 13:40:02
Original
432 people have browsed it

How to Align Text in Bootstrap Tables?

Text Alignment Classes in Bootstrap for Table Elements

Ever need to align text within a table, such as financial figures, right-justified? Bootstrap provides classes to handle this task effortlessly.

Bootstrap 3

To align text right in Bootstrap 3, use the "text-right" class.

<code class="html"><th><span class="text-right">Total</span></th>
<td><span class="text-right">,000,000.00</span></td></code>
Copy after login

Bootstrap 4

In Bootstrap 4, use "text-{breakpoint}-{alignment}":

<code class="html"><p class="text-xs-left">Left-aligned on all viewports</p>
<p class="text-lg-right">Right-aligned on large and wider viewports</p></code>
Copy after login

Bootstrap 5

Bootstrap 5 introduces "text-start" and "text-end":

<code class="html"><p class="text-start">Left-aligned text</p>
<p class="text-end">Right-aligned text</p></code>
Copy after login

These classes provide flexibility for text alignment within tables, allowing you to easily control the presentation of your data.

The above is the detailed content of How to Align Text in Bootstrap Tables?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template