fixed table column width. How?
Can anyone tell me how to give fixed table column width. I have five columns. I want like 30%,20%,10%,30%,10% Can anyone help me? Thanks
<style>
table { table-layout: fixed; }
table th, table td { overflow: hidden; }
</style>
<table class="span12">
<thead>
<tr>
<th style="width: 30%">Col 1</th>
<th style="width: 20%">Col 2</th>
<th style="width: 10%">Col 3</th>
<th style="width: 30%">Col 4</th>
<th style="width: 10%">Col 5</th>
</tr>
</thead>
<tbody>
<tr>
<td>Val 1</th>
<td>Val 2</th>
<td>Val 3</th>
<td>Val 4</th>
<td>Val 5</th>
</tr>
</tbody>
</table>
@jasny Thanks.. Its working. But i still have problem. Its not working when i have lengthy text in the cell. Is there a way to hide the overflow text?.I tried overflow:hidden; But its not working.
@jasny Thanks once again. I added style="table-layout: fixed;" and applied overflow:hidden; in the td. Now its working. :) Thanks
@Viruthagiri I've changed the example. Have a look.
@fat This isn't really an issue, please close it.
Thanks
thanks for the help @jasny!
@jasny thanks!
Finally found an answer!! Thanks !!
Thanks
Thanks @jasny ! Was looking out for this answer for quite a while.
Same here, thanks @jasny. I spent 15 minutes digging through BS determined to find a helper class that did this... guess i'll make my own haha.
Thanks
thanks !