Jump to content

Archived

This topic is now archived and is closed to further replies.

wolves

fill all the the table cell

Recommended Posts

in my table cell I have a <div>

the div style is
[code]

     div.header {
      background:#CCCCCC;  
      text-align:center
    }

[/code]

so it's like
[code]
<td><div class="header">some content</div></td>
[/code]

but if my table cell height is gather than my <div> the div color don't fill all the table cell..

how to solve it?
tanks

Share this post


Link to post
Share on other sites
just put your background color on the table cells themselves:
[code]
td {
  background-color: #cccccc;
}

div.header {
  text-align:center
}
[/code]

Share this post


Link to post
Share on other sites
ok, but then all my talbe cells will have #cccccc background color,
because this, I made the div, when I need that color I use the div,

Share this post


Link to post
Share on other sites
[!--quoteo(post=352148:date=Mar 6 2006, 01:43 PM:name=wolves)--][div class=\'quotetop\']QUOTE(wolves @ Mar 6 2006, 01:43 PM) [snapback]352148[/snapback][/div][div class=\'quotemain\'][!--quotec--]
ok, but then all my talbe cells will have #cccccc background color,
because this, I made the div, when I need that color I use the div,
[/quote]

so, put a class on the cells that you want shaded. you'll not be able to get a div to fill 100% of a table cell. you need to apply the styles to the most basic element in the markup you are using:
[code]
td.shade {
  background-color: #cccccc;
}

div.header {
  text-align: center;
}
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.