Lamberti said:
I've got the problem described in the table above.
I've put a div red with some text inside a TD, but its height is less
than 100% of TD height as you can see.
I've defined the following styles:
div.test { background-color:red; height:100%; width: 100%; }
table.test { border: 1px solid #CCCCCC; background-color:yellow; }
td.test { border: 1px solid #CCCCCC; }
does anyone know a solution ?
I would start by fixing your validation problems, especially the improper
nesting ones:
line 8 column 24 - Warning: missing </font> before <div>
line 8 column 7 - Warning: missing </font> before <div>
line 10 column 1 - Warning: inserting implicit <font>
line 10 column 1 - Warning: inserting implicit <font>
line 10 column 1 - Warning: missing </font> before <style>
line 10 column 1 - Warning: <style> isn't allowed in <font> elements
line 40 column 1 - Warning: <style> isn't allowed in <div> elements
line 40 column 1 - Warning: <style> isn't allowed in <div> elements
line 94 column 53 - Warning: discarding unexpected </font>
line 94 column 60 - Warning: discarding unexpected </font>
line 3 column 7 - Warning: inserting missing 'title' element
line 6 column 1 - Warning: <style> inserting "type" attribute
line 10 column 1 - Warning: <style> inserting "type" attribute
line 41 column 1 - Warning: <style> inserting "type" attribute
line 62 column 1 - Warning: <style> inserting "type" attribute
line 6 column 1 - Warning: trimming empty <style>
line 8 column 24 - Warning: trimming empty <font>
line 8 column 7 - Warning: trimming empty <font>
Then get all of the garbage out. You don't need three instances of the same
style rules. When all is said and done, there is a simple solution. Here is
a complete document that does what you want (and validates):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Test</title>
<style type="text/css">
table {
width: 300px;
border-collapse: collapse;
border: 1px solid #ccc;
background-color: #ff0;
}
td {
border: 1px solid #ccc;
height: 100%;
}
td div {
background-color: #f00;
height: 100%;
}
</style>
</head>
<body>
<table>
<tr><td>2<br>2b</td>
<td><div>1</div></td></tr>
<tr><td>4</td>
<td>5</td></tr>
<tr><td>7</td>
<td>8</td></tr>
</table>
</body>
</html>
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.