wolves Posted March 6, 2006 Share Posted March 6, 2006 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 Quote Link to comment Share on other sites More sharing options...
obsidian Posted March 6, 2006 Share Posted March 6, 2006 just put your background color on the table cells themselves:[code]td { background-color: #cccccc;}div.header { text-align:center}[/code] Quote Link to comment Share on other sites More sharing options...
wolves Posted March 6, 2006 Author Share Posted March 6, 2006 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 Link to comment Share on other sites More sharing options...
obsidian Posted March 6, 2006 Share Posted March 6, 2006 [!--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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.