.scrolltable { overflow:scroll; height:150px; width:130px}
<table id="table1" table border="1"> <thead> <tr> <th>Sample 1</th> <th>Sample 2</th> </tr> </thead> <tbody> <tr> <td colspan="2"> <div class="scrolltable"> <table> <tr> <td>Sample 1</td> <td>Sample 1</td> </tr> <tr> <td>Sample 2</td> <td>Sample 2 Thisdsdfasdfs is sample data</td> </tr> <tr> <td>Sample 3</td> <td>Sample 3</td> </tr> <tr> <td>Sample 4</td> <td>Sample 4</td> </tr> <tr> <td>Sample 5</td> <td>Sample 5</td> </tr> <tr> <td>Sample 6</td> <td>Sample 6</td> </tr> <tr> <td>Sample 7</td> <td>Sample 7</td> </tr> </table> </div> </td> </tr> </tbody> </table>
Thanks, A2H My Blog
<table> <thead> <tr> <th>Head 1</th> <th>Head 2</th> <th>Head 3</th> <th>Head 4</th> <th>Head 5</th> </tr> </thead> <tbody> <tr> <td>Content 1</td> <td>Content 2</td> <td>Content 3</td> <td>Content 4</td> <td>Content 5</td> </tr> </tbody> </table> CSS: table { width: 100%; display:block; } thead { display: inline-block; width: 100%; height: 20px; } tbody { height: 200px; display: inline-block; width: 100%; overflow: auto; }
Login to post response