Topic: Fix Tables Column Width

Hi, I am creating a table and I want to fix the width of td and th. I have fix the width of td and th but they increased in width as data is long. so how can I fix the width of column.

Re: Fix Tables Column Width

It's a bit messy, but couldn't you create a DIV inside of each table cell and control the overflow of the DIV?

Re: Fix Tables Column Width

I think using the col element is going to be your best bet. Something like this should do the trick:

<table>

    <col style="width:100px" />
    <col style="width:200px" />

    <tr>
        <th>Header</th>
        <th>Another Header</th>
    </tr>
    <tr>
        <td>Some content</td>
        <td>Some more content</td>
    </tr>

</table>