Reputation: 18296
How can I fix the width of column in a table and make it be at a given width and not stretch with its content?
I have to say that I put width="300px"
for example in <td>
tag but not changes happen.
Upvotes: 1
Views: 383
Reputation: 34612
Using explicit column sizing with colgroup
usually works for me.
I have prepared a fiddle here.
Upvotes: 0
Reputation: 10219
Use :
<td width="300"></td>
or
<td style="width:300px"></td>
or
<td class="fixedCell"></td>
and
.fixedCell { width:300px; } /* In a CSS file. */
Upvotes: 2
Reputation: 86336
Replace with="300px"
to width="300"
and also table width should be more than the width of cell
Upvotes: 1