Question

I'm trying to set the <th> size for one column. I was trying something like

<th width=100> Description </th>

and the same for <tr> ( <tr width=100>)

The above does not resize the column at all.

Was it helpful?

Solution

You are attempting to use an inline style inside your HTML tags. First off, I recommend quotes around your units of measure like so. <th width="100"></th> Also, you arent defining the units of measure of the tags. you can use: <th width="100px"></th> or <th width="100%"></th> i think that you can even do inches and centimeters. Be careful when using the inline style `length' as the webpage is limitless....

Another way you can do this is using CSS. Inside your head tag could be a <style> tag. Inside you can do: .measure { width:100px; } Note it doesn't have to be pixels. Then on any tag you want 100px wide, you just do: <th class="width"></th> or <tr class="measure"></tr>. Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top