I have an HTML table. I want to keep the first 10 columns of the table fixed and add a horizontal scrollbar to the rest of the columns from the table. I have tried many ways to achieve this. But in the end I had to use a table inside the table, which I want to avoid. Can anyone help me in this regard without using the table inside the table. For your link, I give here the jsFiddle link. If you need more information, I can provide you with the same. Thank you in advance. Waiting for your answers. The jsFiddle link looks like this:
http://jsfiddle.net/zgNMT/1/
The HTML code is as follows:
<table id="outerTable"> <tr> <td style="vertical-align:top;"><div> <table class="fixed"> <tr> <td class="cell">One</td> <td class="cell">Two</td> <td class="cell">Three</td> <td class="cell">Four</td> <td class="cell">Five</td> <td class="cell">Six</td> <td class="cell">Seven</td> <td class="cell">Eight</td> <td class="cell">Nine</td> <td class="cell">Ten</td> </tr> <tr> <td class="cell">One</td> <td class="cell">Two</td> <td class="cell">Three</td> <td class="cell">Four</td> <td class="cell">Five</td> <td class="cell">Six</td> <td class="cell">Seven</td> <td class="cell">Eight</td> <td class="cell">Nine</td> <td class="cell">Ten</td> </tr> </table> </div></td> <td style="vertical-align:top;"><div style="width:230px; overflow-x:scroll;"> <table class="scrolling"> <tr> <td class="cell">One</td> <td class="cell">Two</td> <td class="cell">Three</td> <td class="cell">Four</td> <td class="cell">Five</td> <td class="cell">Six</td> <td class="cell">Seven</td> <td class="cell">Eight</td> <td class="cell">Nine</td> <td class="cell">Ten</td> </tr> <tr> <td class="cell">One</td> <td class="cell">Two</td> <td class="cell">Three</td> <td class="cell">Four</td> <td class="cell">Five</td> <td class="cell">Six</td> <td class="cell">Seven</td> <td class="cell">Eight</td> <td class="cell">Nine</td> <td class="cell">Ten</td> </tr> </table> </div></td> </tr> </table>
source share