Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

why does dreamweaver do this? (tables)



10:09 am on Feb 27, 2006 (gmt 0)

5+ Year Member

I have had this problem before. I have a simple 6 cell table. The outside cells are for my boarders. I have the center set to 100% size so the outer cells should collapse to the size of the images.

I had some problems before because I didnt set all the other outer cells to 0%. But now I did, you can still see that they are not collapsing right. The cells on the sides have collapsed, but not on the top and bottom. Am I missing something?

[edited by: engine at 10:37 am (utc) on Feb. 27, 2006]
[edit reason] See TOS [webmasterworld.com] [/edit]


11:02 am on Feb 27, 2006 (gmt 0)

WebmasterWorld Senior Member suzyuk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

can you post the table code for us..

and also which DTD (Doctype) if any are you using



3:41 pm on Feb 27, 2006 (gmt 0)

5+ Year Member

Grrr, editing out my image will make this harder for someone to understand, but ok then I guess if that's the rules...

Here is my table code.

<table width="387" height="153" border="0" cellpadding="0" cellspacing="0">
<td width="0" height="0%" class="vbordertile"><div align="left">
<p class="hbordertile">&nbsp;</p>
<td width="100%" height="0%" class="hBorderTileTop">&nbsp;</td>
<td width="0" height="0%" class="hbordertile"><div align="right">
<p class="vbordertile">&nbsp;</p>
<td width="0%" class="vBorderTileLeft">&nbsp;</td>
<td width="100%" height="100%" align="center"><div align="center">
<p>This is the middle Cell.</p>

<td width="0" height="115" class="vBorderTileRight">&nbsp;</td>
<td width="0" height="0" class="vbordertile">&nbsp;</td>
<td width="100%" height="0" valign="bottom" class="hBorderTileTop">&nbsp;</td>
<td width="0" height="0" class="hbordertile">&nbsp;</td>

And here is the css:
.vBorderTileRight {
background-image: url(/border_vside.gif);
background-repeat: repeat-y;
right: 10px;
background-position: right;
.vBorderTileLeft {
background-image: url(/border_vside.gif);
background-repeat: repeat-y;
right: 10px;
background-position: left;
.hBorderTileTop {
background-image: url(/border_hside.gif);
background-repeat: repeat-x;
background-position: top;

And here is the very top of the code:
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


3:57 am on Feb 28, 2006 (gmt 0)

5+ Year Member

Hmm, no replies. I guess it's a lot harder to understand the problem without seeing the simple picture.


1:58 pm on Feb 28, 2006 (gmt 0)

10+ Year Member

im guessing here that the borders for this have width value - moreover, the border graphics you created, and are adding via css, are not 0px wide. So, you may need to manually set the width of the first cell, in the first row of the table. Once the first is set, the first cell of the second and third rows will inherit the width value. You can do this in the actual <td> tag or in the css.


11:23 am on Mar 8, 2006 (gmt 0)

5+ Year Member

If you put an <img width="300" ...> in a <td width="100" ...> the cell will autosize to 300px.

But if now you take out the image and set the background of the cell to a image with a width of 300px the cell will not resize.

You either put actualy <img> elements in the cells or set the heights and widths accordingly to the cells. In your case i think the second aproach is the solution to what you want.


Featured Threads

Hot Threads This Week

Hot Threads This Month