TABLE column width problems

  • Thread starter Thread starter Jeronimo Bertran
  • Start date Start date
J

Jeronimo Bertran

I am creating a table and inserting an iframe inside a cell for which
the width depends on the screen size.


The table has 7 columns and the fourth column is resized depeding on the
screen size... here is my complete definition.

<table style="HEIGHT: 472px" cellSpacing="0" cellPadding="0" width="100%"
border="0">
<tr height="1">
<td width="10"></td>
<td width="178"></td>
<td width="16"></td>
<td width="14"></td>
<td></td>
<td width="10"></td>
<td width="11"></td>
</tr>
<tr height="10">
<td width="218" background="Border1.gif" colSpan="4" </td>
<td background="Border2.gif"></td>
<td width="21" background="Border3.gif" colSpan="2"></td>
</tr>
<tr height="16">
<td width="10" background="Border4.gif"></td>
<td width="178" rowSpan="2"></td>
<td width="16" background="Border5.gif"></td>
<td bgColor="white" colSpan="3" rowSpan="2">INSERT POINT</td>
<td width="11" background="images/Border6.gif"></td>
</tr>
<tr>
<td width="10" background="Border4.gif"></td>
<td width="16" background="Border7.gif"></td>
<td width="11" background="Border8.gif"></td>
</tr>
<tr height="25">
<td width="218" background="Border9.gif" colSpan="4"></td>
<td background="Border11.gif"></td>
<td width="21" background="Border12.gif" colSpan="2"></td>
</tr>
</table>

The table works exactly the way I intend it to. Te variable size cell has
a rowspan=2... However, if I replace the text INSERT POINT above with an
IFRAME (or any control for that matter) the columns change their widths.

Any help would be apprecieated.

Jeronimo
 
Don't forget to try to force the table cell widths. Setting a background gif
doesn't actually do this and the table cell will still try to collapse (not
to mention a background for a table cell isn't supported in all browsers.
You're better off actually making the backgrounds as actual images in the
table cell and setting the widths specifically on both the cell and the
image. That may have a better result as the browser won't attempt to
collapse all the cells since they have an image inside them. Otherwise,
they're just another attribute of the table cell and don't necessarily force
the cell open.

Hope tihs helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Mark,

Thanks for the response. After a lot of trial an error I notice that my
main problem has to do with cells that span over more than 1 column or row.
If for example, I have a cell that spans over two columns (colspan = 2), if
the width of the contents of the cell is greater than the width of the
first column, then the width of the column is changed, even thought the
second column that is spans into has more than enough space.
 
Hi Jeronimo,

Is the ifame's size fixed? And, if you set a fixed size for the cell, will
its width change in the problem?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top