How can I rotate text vertically in an HTML table?

Mary-Kate Olsen
Release: 2024-11-02 00:23:02
Original
417 people have browsed it

How can I rotate text vertically in an HTML table?

Vertical Text in HTML Tables

Rotating text vertically within HTML table cells is a common query for optimizing space in dense tables. To attain this effect, a popular approach leverages the transform property to define CSS styles.

One method involves the use of the CSS rotate property:

.box_rotate {
  -moz-transform: rotate(7.5deg);  /* FF3.5+ */
  -o-transform: rotate(7.5deg);  /* Opera 10.5 */
  -webkit-transform: rotate(7.5deg);  /* Saf3.1+, Chrome */
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083);  /* IE6,IE7 */
  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)"; /* IE8 */
}
Copy after login

By applying this style to a table cell, the text within will be rotated 7.5 degrees counterclockwise:

<code class="html"><td>
  <div class="box_rotate">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  </div>
</td></code>
Copy after login

This technique allows you to transform text vertically, effectively saving space in tables with extensive headings or text.

The above is the detailed content of How can I rotate text vertically in an HTML table?. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!