Is there a (portable) way to rotate text in a HTML table cell by 90°?
(I have a table with many columns and much text for the headings, so I'd like to write it vertically to save space.)
Is there a (portable) way to rotate text in a HTML table cell by 90°?
(I have a table with many columns and much text for the headings, so I'd like to write it vertically to save space.)
I was using the Font Awesome library and was able to achieve this affect by tacking on the following to any html element.
Your mileage may vary.
My first contribution to the community , example as rotating a simple text and the header of a table, only using html and css.
HTML
CSS
Here an example in jsfiddle
Alternate Solution?
Instead of rotating the text, would it work to have it written "top to bottom?"
Like this:
I think that would be a lot easier - you can pick a string of text apart and insert a line break after each character.
This could be done via JavaScript in the browser like this:
... or you could do it server-side, so it wouldn't depend on the client's JS capabilities. (I assume that's what you mean by "portable?")
Also the user doesn't have to turn his/her head sideways to read it. :)
Update
This thread is about doing this with jQuery.
Here is one that works for plain-text with some server side processing:
which gives something like:
http://jsfiddle.net/TzzHy/
IE filters plus CSS transforms (Safari and Firefox).
IE's support is the oldest, Safari has [at least some?] support in 3.1.2, and Firefox won't have support until 3.1.
Alternatively, I would recommend a mix of Canvas/VML or SVG/VML. (Canvas has wider support.)