Help CSS "tables"

liloe

It's my birthday today!
Joined
Jan 25, 2004
Messages
4,168
Oooook, I have a little problem with CSS and I thought hey, maybe someone around here has done some work with it.

Basically I want to adapt the following HTML structure to CSS:

Code:
<table width="90%" border="1">
     <tr>
          <td width="20%"></td>
          <td width="80%"></td>
     </tr>
</table>

Now the problems are the following:
  • the height should be fit to content. This is no problem with 1 line using height:1.5em; but with multiple lines it's getting tricky. It seems to kill background-color when I don't use the height attribute :<
  • % values don't seem to work regarding the width of the complete HTML page
  • Everything needs to be relative, so that the zoom function of the browsers works correctly

Any ideas?
 

ST^

Can't get enough of FH
Joined
Dec 22, 2003
Messages
2,351
You mean you wanna use <div>'s instead of tables or what? I can't really work out what you want.
 

liloe

It's my birthday today!
Joined
Jan 25, 2004
Messages
4,168
You mean you wanna use <div>'s instead of tables or what? I can't really work out what you want.

Basically I want to use one <div> for each <td>, yes.

Code:
#a_date{
	border:2px solid #000000;
	width:10em;
	height:auto;
	position:absolute;
	background-color:#DDD;
	font-weight:bold;
}
#a_info{
	border:2px solid #000000;
	height:auto;
	position:absolute;
	background-color:#DDD;
	left:10em;
	font-weight:bold;
}

So basically I have 2 <td>s there, the first with a width of "10em" and the second with no width set.
My problem is, that I can't work out how to make it, so that both together use a max of 90% of the current framewidth. Sure I can set a framewidth manually and then set the width of #a_info manually as well, but that would be against the idea of having a dynamic adjustement.
 

Users who are viewing this thread

Top Bottom