• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can I specify the size of a col in a table?HTML

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I specify the size of a col in a table in HTML.
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure can. Looks like this <td width="50"> Not all browsers support height, so I never use height="xx". Also you can sometimes run into problems if your width you specified on the table does not add up to the widths you specified for you columns, or if you use width="100%". One thing I have learned to do for easy programming, is use spacer gifs and define all of my column widths in the first row using spacer gifs to help force it. So my first row looks like this:
<table width="100">
<tr>
<td width="25"><img src="spacer.gif" height="1" width="25"></td>
<td width="25"><img src="spacer.gif" height="1" width="25"></td>
<td width="25"><img src="spacer.gif" height="1" width="25"></td>
<td width="25"><img src="spacer.gif" height="1" width="25"></td>
</tr>
That way, I don't need to specify the width anymore, and if I need to change the width of the columns, I only have to do it on the first row. (In case you weren't sure, a spacer gif is a 1x1 transparent gif).
One more note, in Netscape, try not to use empty TD's. So don't use <td width="25"></td> because netscape will ignore these. I will usually put in a nonbreaking space (  if I know the column is wide enough to handle a nonbreaking space. If the column is only 1 pix wide, then I use the spacer gif again.
Hope that helps and is not too confusing, but the short answer is yes.
 
reply
    Bookmark Topic Watch Topic
  • New Topic