Jump to content


Photo

fill all the the table cell


  • Please log in to reply
3 replies to this topic

#1 wolves

wolves
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 06 March 2006 - 06:07 PM

in my table cell I have a <div>

the div style is

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


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

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

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 06 March 2006 - 06:09 PM

just put your background color on the table cells themselves:
td {
  background-color: #cccccc;
}

div.header {
  text-align:center
}

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 wolves

wolves
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 06 March 2006 - 06:43 PM

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,

#4 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 06 March 2006 - 06:52 PM

[!--quoteo(post=352148:date=Mar 6 2006, 01:43 PM:name=wolves)--][div class=\'quotetop\']QUOTE(wolves @ Mar 6 2006, 01:43 PM) View Post[/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:
td.shade {
  background-color: #cccccc;
}

div.header {
  text-align: center;
}

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users