css width of <td>

D

David Dorward

J.P. said:
I don't see what I'm doing wrong, but why does the 'master-menu' not
scale to a width of 200px?
Can somebody explain this, I really don't see what is wrong?

You've set one cell to be 200px wide and another cell in the same row to be
100% wide. How can one cell take up all the room and still leave 200 pixels
for another cell? This is how Captain Kirk makes evil computers
self-destruct! ;)

Since it looks very much like you are abusing tables for layout, the
simplest thing would be to stop doing that.

http://css-discuss.incutio.com/?page=TwoColumnLayouts
 
J

J.P.

Hi,

I don't see what I'm doing wrong, but why does the 'master-menu' not
scale to a width of 200px?
Can somebody explain this, I really don't see what is wrong?

J.P.

-- File: index.php --
<html>
<head>
<link type="text/css" rel="stylesheet" href="style.css">
</head>
<body>
<table class="master">
<tr>
<td class="master-head" colspan="2">head</td>
</tr>
<tr>
<td class="master-menu">menu</td>
<td class="master-work">work</td>
</tr>
</table>
</body>
</html>


-- File: style.css --
body {
margin: 0px;
}

table.master {
width: 100%;
height: 100%;
}

td.master-head {
width: 100%;
height: 75px;
}

td.master-menu {
width: 200px;
height: 100%;
}

td.master-work {
width: 100%;
height: 100%;
}
 
L

Lauri Raittila

in said:
Hi,

I don't see what I'm doing wrong,

Me neiher. Where is your URL?
but why does the 'master-menu' not
scale to a width of 200px?

Because you are using table layout. Anyway, why do you want it to be
200px?
Can somebody explain this, I really don't see what is wrong?

The table model of IE just don't work that way. Especially when in quirks
mode (in case the same bugs are emulated widely...).

Use CSS.
http://www.allmyfaqs.com/faq.pl?Tableless_layouts

Should be easy to get your site work better with CSS than with tables on
all browsers.
 
J

J.P.

David Dorward schreef:
J.P. wrote:




You've set one cell to be 200px wide and another cell in the same row to be
100% wide. How can one cell take up all the room and still leave 200 pixels
for another cell? This is how Captain Kirk makes evil computers
self-destruct! ;)

I thought my browser was more intelligent :D I thought it should think:
I've used 200px for one column, so the rest is the 100%.
But now I'm writing this, I see it's kinda stupid.
Since it looks very much like you are abusing tables for layout, the
simplest thing would be to stop doing that.

http://css-discuss.incutio.com/?page=TwoColumnLayouts

Thanks for the link. I will start reading. I took the "table layout
thing" from two different books. I looked like a good idea, but it's
seams totally wrong.
 
J

J.P.

Lauri Raittila schreef:
Me neiher. Where is your URL?

Well, it was so simple, is the URL really needed?? :D
Because you are using table layout. Anyway, why do you want it to be
200px?

I just put it there. But if you want to I can also set it to 100px;
The table model of IE just don't work that way. Especially when in quirks
mode (in case the same bugs are emulated widely...).

Use CSS.
http://www.allmyfaqs.com/faq.pl?Tableless_layouts

Should be easy to get your site work better with CSS than with tables on
all browsers.

Also thanks for the link.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,589
Members
45,100
Latest member
MelodeeFaj
Top