tags:

views:

151

answers:

4

Hi. I have a setup that looks like this:

<html><head><style>
table{
    height:100%;
    width:100%;
    padding:0 20px 20px 20px;
    min-height:540px;
    min-width:720px;
}
tr.head{
    height:35px;
    background:black;
}
td.left-bar{
    background-color:green;
    width:220px;
}
td.spacer{
    width:10px;
}
td.right-bar{
    background-color:blue;
}
div.sb-top{
    height:20px;
    background-color:red;
}
div.sb-bottom{
    height:100%;
    background-color:yellow;
    padding:10px;
}
</style></head><body>
<table>
    <tr class="head"><td colspan='3'></tr>
    <tr>
     <td class="left-bar"><div class="sb-top"></div><div class="sb-bottom"></div></td>
     <td class="spacer"></td><td class="right-bar"></td>
    </tr>
</table>
</body></html>

However, when I do this both the height and padding on sb_bottom cause it to overflow past the cell. I'm not so concerned about the right/left overflow, but I absolutely must fix the bottom overflow. How can I do this? Thank you!

A: 

get rid of your height and width 100% requirements... it will spread on its own. also, your min-heights and widths may be playing factors here... you can get rid of those too

Jason
Tables will automatically grow with content, sure, but what if there is not that much content in there? You can't just remove the height or min-height statements.
nickf
that is a design issue then...
Jason
+1  A: 

How about moving the padding to the body instead of the table?

If that does not work, you can put the table in a div and give the div the appropriate margins instead of a padding.

jeroen
+1  A: 

You could always put an inner wrap inside of sb_bottom and give that the padding. That way it won't overflow.

Ballsacian1
A: 

This is probably just a hack, but I added padding-bottom to the left-bar and it looks okay.

td.left-bar{
    background-color:green;
    width:220px;
    padding-bottom:40px;
}

I loaded up the sb-bottom div with text and it scrolled off the screen, but I wasn't sure if you wanted the height to be fixed or to be scrollable.

fudgey