Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diagonal Column Headers

I have column headers with long text in a html table, and I'd like to display the headers at a 45 degree angle (similar to what can be done in Excel).

Is there a standard, cross-browser way to do this with CSS or JavaScript?

I started playing with css3please.com, but the rotation doesn't seem to work, at least in IE 7. Also, another issue is that CSS rotates around the center of the element, while I need to rotate around the left side.

Any pointers will be appreciated!

like image 899
Christophe Avatar asked Apr 16 '11 03:04

Christophe


People also ask

What is a column header called?

All values in a column, which belong to a particular domain, are of same data type. A column header is called an attribute.

How do I split column headers?

We right-click the Column1 header and select Split Column > By Delimiter. The following dialog appears, where we can confirm the default options or make any changes needed.

Where is column header in Excel?

Go to Table Tools > Design on the Ribbon. In the Table Style Options group, select the Header Row check box to hide or display the table headers.


1 Answers

Demo: http://jsfiddle.net/wdm954/Z2HHu/1/

-moz-transform:rotate(-45deg);
-webkit-transform:rotate(-45deg);
transform: rotate(-45deg);
like image 104
wdm Avatar answered Sep 20 '22 17:09

wdm