Bootstrap Skeleton
This is a simple Bootstrap skeleton. You can fork it to get a ready to use Bootstrap fiddle.
HTML
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<div class="scrollable-table">
<table class="table table-striped table-header-rotated">
<thead>
<tr>
<!-- First column header is not rotated -->
<th></th>
<!-- Following headers are rotated -->
<th class="rotate-45"><div><span>Column header 1</span></div></th>
<th class="rotate-45"><div><span>Column header 2</span></div></th>
<th class="rotate-45"><div><span>Column header 3</span></div></th>
</tr>
</thead>
<tbody>
<tr>
<td class="row-header">Row header 1</td>
<td>33</td>
<td>978</td>
<td>57</td>
</tr>
<tr>
<td class="row-header">Row header 2</td>
<td>99</td>
<td>678</td>
<td>67</td>
</tr>
<tr>
<td class="row-header">Row header 3</td>
<td>332</td>
<td>701</td>
<td>877</td>
</tr>
</tbody>
</table>
</div>
CSS
body{padding:30px;}
.table{width:93%;}
.table-header-rotated th.row-header{
width: auto ;
}
.table-header-rotated td{
width: 40px;
border-top: 1px solid #dddddd;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
vertical-align: middle;
text-align: center;
}
.table-header-rotated th.rotate-45{
height: 80px;
position: relative;
vertical-align: bottom;
padding: 0;
font-size: 12px;
line-height: 0.8;
}
.table-header-rotated th.rotate-45 > div{
position: relative;
top: 0px;
left: 40px; /* 80 * tan(45) / 2 = 40 where 80 is the height on the cell and 45 is the transform angle*/
height: 100%;
transform:skew(-45deg,0deg);
overflow: hidden;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
border-top: 1px solid #dddddd;
}
.table-header-rotated th.rotate-45 span {
transform:skew(45deg,0deg) rotate(315deg);
position: absolute;
bottom: 30px; /* 40 cos(45) = 28 with an additional 2px margin*/
left: -25px; /*Because it looked good, but there is probably a mathematical link here as well*/
display: inline-block;
width: 85px; /* 80 / cos(45) - 40 cos (45) = 85 where 80 is the height of the cell, 40 the width of the cell and 45 the transform angle*/
text-align: left;
}
.table-header-rotated th:first-of-type,.table-header-rotated td:first-of-type{
text-align:left;
}
}