vertical-align baseline moving table

T

tshad

I have been trying to track this problem for awhile and have finally found
the cause.

I have a table in a table. I want to set all my text to
vertical-align:baseline. This would leave the text towards the top of the
cell and line adjacent cells according to the baseline of the text. Top
doesn't work as adjacent cells don't necessarilly align correctly.

The problem is that IE 6, want's to move the whole table up. What happens
is that the top of the table is hacked off and you get the last couple of
lines of text.

This doesn't happen with vertical-align:top or vertical-align:bottom. It
only moves the text.

If the problem were that it was trying to move the table inside of the <td>
tag, it should do the same for vertical-align:top. But it doesn't.

Mozilla has no problem at all with this.

However, Mozilla won't print the border-color, whereas IE will.

What is happening here?

I have 3 files:
http://www.payrollworkshop.com/development/defaulttest1.htm
vertical-align:top
http://www.payrollworkshop.com/development/defaulttest1.htm
vertical-align:bottom
http://www.payrollworkshop.com/development/defaulttest1.htm
vertical-align:baseline

The code:
*************************************************************************
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Home Page</title>
<style type="text/css">
body {
margin:0;
}
td {
font-size: 10;
text-decoration: none;
vertical-align:bottom;
empty-cells: show;
}
</style>
</head>
<body>

<table width="100%" style="height:100%; border-color:#00FF99" border="1"
cellspacing="0" cellpadding="0">
<tr height="63">
<td>test 1</td>
</tr>
<tr style="height:20px; ">
<td >test 2</td>
</tr>
<tr>
<td>

<table width="100%" style="height:100%; border-color:#CC3333;"
border="5" cellspacing="0" cellpadding="0">
<tr>
<td>
<p align="center" class="thankYouMessage">Welcome to our Employment
Website</p>
<p align="center">Whats New</p>
<p align="center">Calendar of Events</p>
<p align="center">Summary</p>
<p align="center">Search</p>
<p align="center">Create/Modify Profile </p>
<p align="center">&nbsp; </p>
</td>
</tr>
</table>

</td>
</tr>
<tr style="height:20px">
<td>test 3</td>
</tr>
<tr style="height:20px">
<td >test 4</td>
</tr>
</table>
</body>
</html>
***************************************************************************

Thanks,

Tom
 
O

Oli Filth

tshad said:
I have been trying to track this problem for awhile and have finally found
the cause.

I have a table in a table. I want to set all my text to
vertical-align:baseline. This would leave the text towards the top of the
cell and line adjacent cells according to the baseline of the text. Top
doesn't work as adjacent cells don't necessarilly align correctly.

The problem is that IE 6, want's to move the whole table up. What happens
is that the top of the table is hacked off and you get the last couple of
lines of text.

This doesn't happen with vertical-align:top or vertical-align:bottom. It
only moves the text.

If the problem were that it was trying to move the table inside of the <td>
tag, it should do the same for vertical-align:top. But it doesn't.

Mozilla has no problem at all with this.

However, Mozilla won't print the border-color, whereas IE will.

What is happening here?

You don't have a <!DOCTYPE> declaration.

P.S. You shouldn't specify font-sizes, heights, etc. without units.

i.e. it should be height="63px", not height="63".
 
T

tshad

Oli Filth said:
You don't have a <!DOCTYPE> declaration.

P.S. You shouldn't specify font-sizes, heights, etc. without units.

i.e. it should be height="63px", not height="63".

I added the Doctype and 63px, but defaultest.htm is still moving the box up.

Also, why is IE showing the red and green borders and Mozilla not. It is
showing a stylized type of border, but it is grey.

Tom
 
O

Oli Filth

tshad said:
I added the Doctype and 63px, but defaultest.htm is still moving the box up.

Not when I try the version I made (i.e. your code with the HTML 4.01
Strict DOCTYPE).
Also, why is IE showing the red and green borders and Mozilla not. It is
showing a stylized type of border, but it is grey.

In my copy, IE, FF, and Opera all display the colours correctly.
 
T

tshad

Oli Filth said:
Not when I try the version I made (i.e. your code with the HTML 4.01
Strict DOCTYPE).

That did it.

http://www.payrollworkshop.com/development/defaulttest5.htm
In my copy, IE, FF, and Opera all display the colours correctly.

Only if set to Strict (as you mentioned above) for Mozilla. If set to
traditional, Mozilla shows grey.

Also, I noticed that Mozilla (when set to Strict) shows the thick red border
as a sort of pink on the top and left sides of the border and dark red for
the bottom and right sides. This is a little different than IE 6 which
shows the red as dark red for top and left and darker red for bottom and
right. Not a problem, just would not look the way you designed it in one or
the other browsers.

Also, what do I lose if I go to STRICT instead of Traditional in my DOCTYPE
declaration?

Thanks,

Tom
 

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

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top