Template:Vertical

From RepRap
Revision as of 16:53, 10 June 2013 by Traumflug (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This template rotates text by -90 deg. This is, for example, useful for table headers, where the header is much wider than the actual contents.

Usage

{{Vertical|<width>|<height>|<text>}}

Make sure to have no spaces after <width> and <height>! If you have, the template engine inserts a non-breaking space there and the values will be ignored. Maybe this is a bug of the currently used wiki software.

Parameters

1
Width of the (visible or invisible) text box. To deal with different font size it's better to use em instead of px or mm.
2
Extra height of the (visible or invisible) text box. To deal with different font size it's better to use em instead of px or mm. This height is added to the height of the unrotated text box, so some experimenting might be neccessary.
3
Actual text to be rotated. It's a good idea to add a non-breaking space in front of the text to get some distance to the bottom of the text box and to replace line-breaking characters like ordinary spaces with non-breaking (&nbsp;) ones.

Example with table

{| class="wikitable"
! Table
! {{Vertical|1.5em|4em|&nbsp;vertical}}
! style="vertical-align: bottom;" | horizontal
|-
| Item
| X
| not vertical
|}

results in:

Table
 vertical
horizontal
Item X not vertical

Example with plain text

Plain text with partially
{{Vertical|1.5em|2.8em|vertical}}
text.

results in:

Plain text with partially

vertical

text.

Bugs

  • Not very useful for inlined text. Text gets rotated, but at the center of the text box, which usually gives unexpected results.
  • Text box size doesn't match its contents, so line wrapping has to be prohibited.