Home  >  Article  >  Web Front-end  >  How can I align text in tables using Twitter Bootstrap?

How can I align text in tables using Twitter Bootstrap?

Susan Sarandon
Susan SarandonOriginal
2024-11-02 11:17:02974browse

How can I align text in tables using Twitter Bootstrap?

Table Text Alignment in Twitter Bootstrap

In Twitter's Bootstrap framework, you can align text within tables using designated text alignment classes.

Bootstrap 3

  • text-left: Left aligned text
  • text-center: Center aligned text
  • text-right: Right aligned text

Bootstrap 4

  • text-xs-{left|center|right}: Align text for all viewport sizes
  • text-{sm|md|lg|xl}-{left|center|right}: Align text for specific viewport sizes

Bootstrap 5

  • text-start: Left aligned text (replaces text-left)
  • text-end: Right aligned text (replaces text-right)

Example:

Align the total in a table cell to the right:

<th class="text-end">Total</th>
<td class="text-end">,000,000.00</td>

Additional Notes:

  • The provided examples align text within table headers (th) and data cells (td).
  • Refer to the official Bootstrap documentation for more detailed information on text alignment classes.

The above is the detailed content of How can I align text in tables using Twitter 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