Forum Moderators: not2easy

Message Too Old, No Replies

extending text to 100% height of table cell

         

moriax

6:11 pm on Mar 25, 2006 (gmt 0)

10+ Year Member



I have a single word inside a table cell. it's currently a <h2> tagd word. The problem is that I whant to extend the height of the <h2> tag to cover the entire height of the cell. Or similar solution.

Why?

Because I have a set of divs inside the cell containing a rounded background color. And I want the height of this background to consist with surrounding cells. As for now, the background only covers the height of the cell content (my <h2> tag).

I'm kind of stuck on how to solve this?

birdbrain

6:42 pm on Mar 25, 2006 (gmt 0)



Hi there moriax,

does this help....


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
div {
height:200px;
width:324px;
border:1px solid #000;
margin:auto;
}
h1 {
line-height:200px;
background-color:#fee;
color:#000;
text-align:center;
margin:0;
}
-->
</style>
</head>
<body>
<div>
<h1>word</h1>
</div>
</body>
</html>


birdbrain

moriax

7:01 pm on Mar 25, 2006 (gmt 0)

10+ Year Member



well...

You see, the surrounding cells are dynamic in height depending on the content. So, the height of the text cant be specified in px. It need some 100% thingy. But I can't get my head around it.

birdbrain

7:21 pm on Mar 25, 2006 (gmt 0)



Hi there moriax,

I only put line-height to center the text. If you just require the <h2> element to fill the cell use height:100% instead.

birdbrain

moriax

7:27 pm on Mar 26, 2006 (gmt 0)

10+ Year Member



Nope, can't still make it work. Here is a code snippet of my problem:

CSS:


.roundcont {
background-color: #f90;
color: #fff;
height:100%;
}
.roundtop {
background: url(../images/tr.gif) no-repeat top right;
}
.roundbottom {
background: url(../images/br.gif) no-repeat top right;
}
img.corner {
width: 15px;
height: 15px;
border: none;
display: block!important;
}

html:


<td>
<div class="roundcont">

<div class="roundtop">
<img src="../images/tl.gif" alt="" width="15" height="15" class="corner" style="display: none" />
</div>
<h2>headline</h2>
<div class="roundbottom">
<img src="../images/bl.gif" alt="" width="15" height="15" class="corner" style="display: none" />
</div>

</div>
</td>

<td>
bla bla bla...some dynamic content here determening the height of cell...
</td>

Anyone got a solution to this?

moriax

12:52 pm on Mar 28, 2006 (gmt 0)

10+ Year Member



ok? Seems like there is no solution to this. Any other thoughts on how to get rounded background with similar height on all cells?