After experimenting with different versions, I keep encountering the same issue - either the header expands in size as I scroll or the th and td cells are not aligned properly. Take a look at this fiddle for the full HTML and CSS: The scrolling function works perfectly, but you'll notice that the th and td elements progressively fall out of line with each other. Check it out here
<table>
<thead>
<tr>
<th class="th-right" >Fruit</th>
<th class="td-left" >Colour</th>
<th class="td-left" >Status</th>
<th class="th-right" >Number
<span class="up" text-align="right"> back to top ↑<span>
</th>
</tr>