Allaire Homesite/Table formatting

Advertisement


Question
How can I control the width of columns in my tables? I usually put in the width in width="..%" but that doesn`t always give me an accurate measure. This is more an HTML than a Homesite question I guess, but do you have any advice?
Thanks.
Brigitte

Answer
Hi Brigitte,
Your problem is a common one. Not only are you running into trouble with formatting column widths, but there is also the problem of cross browser compatability (ie. what looks good in Netscape.x, doesn't always look nice in IE.x.

I have found that most problems with tables will occur in Netscape. To get around them you need to do the following:

1) Set your table width, in pixels.
  <table width="500">

2) Now when you define your columns you also need to define their width in pixels:

<tr>
  <td width="100">Cell Contents Here</td>
  <td width="100">Cell Contents Here</td>
  <td width="100">Cell Contents Here</td>
  <td width="100">Cell Contents Here</td>
  <td width="100">Cell Contents Here</td>
</tr>
</table>
The above code makes 5 columns, that are 100 pixels wide. Yo have to do it this way in order to get netscape to cooperate. If you leave a couple of the columns without widths, netscape does some crazy things sometimes.

3) Once you define the column widths, you don't have to do in in any of the following rows.

4) Also remember that if you put something (like an image) into one of the cells, that is 200 pixels wide, by default the cells will stretch to fit the object, which will throw off the table dimensions you defined earlier. This applies to images, and long strings of text with no spaces.

5) Finally remember the cellpadding, and cellspacing attributes. Set them to "0" if you are cutting up images to put together within a table.

If this does not answer your question, I can be reached at webmaster@nfldweb.com, if you have more specific questions.

Remember "Before there is proficiency, there is drudgery". Keep at it, and it will come together eventually.

As a final note, make sure you do your coding by hand. It gives you better control. When you use WYSIWYG editors, you often don't have a clue what's going on at the code level. This will be a problem if you ever get into more complex layouts.

Hope this helps,
Mark Jenkins

Allaire Homesite

All Answers


Ask Experts

Volunteer


Mark Jenkins

Expertise

I have used homesite exclusively for HTML/ASP development for about 3 years. I know most features of the program.

Experience

5 Years graphic design / HTML development

Organizations
Owner / Operator of New Found Web Solutions. A company dedicated to providing affordable, yet grapically appealing web sites to home - based, small and mid-sized businesses.

Education/Credentials
Bachelor of Education.
Master of Science

©2012 About.com, a part of The New York Times Company. All rights reserved.