cell won't align to top vertically

This is a discussion on "cell won't align to top vertically" within the Web Page Design section. This forum, and the thread "cell won't align to top vertically are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Sep 29th, 2006, 18:09
New Member
Join Date: Sep 2006
Location: Canada
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
cell won't align to top vertically

Hi, I have some content that won't vertically align.
I want content (HOT DEALS, etc.) in the left column to align at the top when the page is stretched, say by adding more text on the right.
The left cell includes a graphic image, text, a form, and some PHP.

I have researched and tried everything I can think of.
Any idea why this content won't align at the top?
(replacing it with some plain text and using valign="top" works.)
Thanks for any help.

Here's a link: http://www.gobeyondmag.com/HomeLife/index.php
Here's the code:

<TD ROWSPAN=3 valign="top" class="noborderBox"> <img src="../images/spacer.gif" width="109" height="10">
<br> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>HOT
DEALS</strong> from</font><br> <span class="stayGreen"><a href="../page.php"><font size="2"><strong>Text here</strong></font></a></span>
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST'){
$me = $_SERVER['PHP_SELF'];
?>
<form name="form1" method="post"
action="<?php echo $me;?>">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td><input type="text" name="email" size=13></td>
</tr>
<tr>
<td><input type="submit" name="Submit"
value="Subscribe"></td>
</tr>
</table>
</form>
<?php
} else {
error_reporting(0);
//
$recipient = 'me@home.com';
$subject = 'subscriber';
$from = stripslashes($_POST['Name']);
$msg = "This person has subscribed";
$mailheaders = "From: $email\n";
$mailheaders .= "Reply-To: $email\n\n";
if (mail($recipient, $subject, $msg, $mailheaders))
echo nl2br("<font color=#339900 size=2 face='Verdana, Arial, Helvetica, sans-serif'></font>
<font color=#0033CC size=2 face='Verdana, Arial, Helvetica, sans-serif'>Thank-you for saving with RealSteals!<br>");
else
echo ("<font color=#FF0000 size=2 face='Verdana, Arial, Helvetica, sans-serif'>Message failed to send, please try again later.</font>");
}
?>
<strong><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif" >BUSINESS</font></strong><font color="#009933"><br>
<span class="themeText"><a href="../getlisted.php">Get Listed</a><br>
<a href="../interview.php">interviews</a><br>
<a href="../design.php">design</a><br>
<a href="../advertise.php">advertise</a></span></font></TD>
Attached Images
File Type: jpg alignment.jpg (68.5 KB, 41 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Sep 30th, 2006, 14:03
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

From your linked page, I'm not sure I see where your problem is at the moment.

Something I would say, and I know it's not what you asked, but you really should code your pages up properly.

You need a DOCTYPE at the very top of your page.

Mark-up your page according to that type.

Use proper css styling with the code in a separate file that is <link... ed into your pages.

DO NOT use proprietary styling or other attributes.

Your pages need to be cross-browser and accessibility compatible.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 2nd, 2006, 13:07
New Member
Join Date: Sep 2006
Location: Canada
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

Of course, I don't have the error showing live at the moment, that is why the attached image. The error only appears when there's enough content to make the page longer (as in the blank returns in the screen-shot).

Can anyone help with this problem?
Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 2nd, 2006, 14:14
SuperMember

SuperMember
Join Date: Aug 2003
Location: Castle Rock, CO
Age: 36
Posts: 163
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

As the other poster stated, using the proper DOCTYPE will help you some. And instead of using the
Code: Select all
valign="top"
he is recommending using CSS and applying the
Code: Select all
style="vertical-align:top;"
to your <td> tag
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 2nd, 2006, 15:15
New Member
Join Date: Sep 2006
Location: Canada
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

Quote:
Originally Posted by Corey Bryant View Post
As the other poster stated, using the proper DOCTYPE will help you some. And instead of using the
Code: Select all
valign="top"
he is recommending using CSS and applying the
Code: Select all
style="vertical-align:top;"
to your <td> tag
Thank-you both. I have tried both and they do not help.
(and I will be addressing the other issues.)

When I remove the cells and replace them with one cell, it aligns to the top as desired. When I remove the cells and replace them with multiple cells, they stretch and center vertically as undesired. So it appears to be related to having more than one cell. (Which I need for the forms?).

This seems to be a function of the way cells interact, which I don't have that "feel" for yet.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 2nd, 2006, 21:02
SuperMember

SuperMember
Join Date: Aug 2003
Location: Castle Rock, CO
Age: 36
Posts: 163
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

What is in the class noborderBox ? It is sometimes difficult to tell with just a bit of the code. Do you have all the parsed code perhaps?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 2nd, 2006, 22:53
New Member
Join Date: Sep 2006
Location: Canada
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

Quote:
Originally Posted by Corey Bryant View Post
What is in the class noborderBox ? It is sometimes difficult to tell with just a bit of the code. Do you have all the parsed code perhaps?
Here's the .css :
(Thanks for your continued interest

.mainBox {
border: thin solid #CCCCCC;
padding-left: 8px;
background-repeat: no-repeat;
padding-top: 8px;

}
.noborderBox {
border: thin none #CCCCCC;
padding-left: 8px;
vertical-align: top;
}
.bottomLine {
border-bottom-width: thin;
border-bottom-style: solid;
border-bottom-color: #CCCCCC;
}
.topLine {
border-top-width: thin;
border-top-style: solid;
border-top-color: #CCCCCC;
}
a:link {
color: #009900;
text-decoration: none;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10.5px;
}
a:hover {
color: #000000;
text-decoration: underline;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10.5px;
}
a:visited {
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10.5px;
text-decoration: none;
}
.themeText {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10.5px;
}
.otherLink A:link {text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10.5px; color: black;}
.otherLink A:visited {text-decoration: underline; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10.5px; color: black;}
.otherLink A:hover {text-decoration: underline; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10.5px; color: black;}
}
.stayGreen A:link {color: green;}
.stayGreen A:visited {color: green;}
.stayGreen A:active {color: green;}
.stayGreen A:hover {
color: green;
text-decoration: underline;
}
.blackBox {
border: thin solid #000000;
}
.copyright {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
color: #999999;
}
.topic {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: normal;
color: #000000;
}
.noLink {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10.5px;
color: #999999;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 3rd, 2006, 13:10
SuperMember

SuperMember
Join Date: Aug 2003
Location: Castle Rock, CO
Age: 36
Posts: 163
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

Well you have it there in the code
Code: Select all
.noborderBox {
border: thin none #CCCCCC;
padding-left: 8px;
vertical-align: top;
}
is there a chance that we could see the parsed code so that we can take a look at what is being generated by the PHP and the other to see if we can come up with other ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 3rd, 2006, 13:39
New Member
Join Date: Sep 2006
Location: Canada
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

Quote:
Originally Posted by Corey Bryant View Post
Well you have it there in the code
Code: Select all
.noborderBox {
border: thin none #CCCCCC;
padding-left: 8px;
vertical-align: top;
}
is there a chance that we could see the parsed code so that we can take a look at what is being generated by the PHP and the other to see if we can come up with other ideas?
Hi Corey,

What do I have in the code? The code says to align to the top, but it does not.

All of the PHP code was posted above in my very first post. Not sure what you mean, so I will post all code again. Actually, I will post a simplified version that has the same problem.

This is the strangest thing. I carefully re-built the page from scratch, testing with each change, looking to find the "thing" that causes this... thought I had successfully re-built it (though still not knowing what was the difference) --when Bam! the problem surfaced again.

Now, it's personal! haha
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Oct 3rd, 2006, 17:59
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

I was just having a quick scan through your code above and noticed lots of 'font-size: 10.5px;'.

You can't have 0.5 pixel. A pixel is by definition a unitary thing. You can have 10.5em but not 10.5px. Quite what interpretation a browser might put on it is anyone's guess.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Oct 3rd, 2006, 21:06
New Member
Join Date: Sep 2006
Location: Canada
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

Quote:
Originally Posted by ukgeoff View Post
I was just having a quick scan through your code above and noticed lots of 'font-size: 10.5px;'.

You can't have 0.5 pixel. A pixel is by definition a unitary thing. You can have 10.5em but not 10.5px. Quite what interpretation a browser might put on it is anyone's guess.
Ahhhh (can you tell I came from the print side of things and habits persist?).
Thanks! Doubt it will help with the problem--but with web design, anything is possible, I'm finding.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Oct 3rd, 2006, 22:08
SuperMember

SuperMember
Join Date: Aug 2003
Location: Castle Rock, CO
Age: 36
Posts: 163
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

What I mean is the way it is see in the browser. If you go to any site - ASP, PHP, etc and go to View Source, you will see the parsed code (as a search engine sees it) and then that way we can see everything
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Oct 4th, 2006, 00:22
New Member
Join Date: Sep 2006
Location: Canada
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: cell won't align to top vertically

No, you can't see the PHP when you view source in a browser...
That is why I provided the PHP separately.

UPDATE:
While I have not been able to find the reason for this problem, I did notice that it did not happen when there was only one cell <TD> in the left column, so I put the graphic image of the house in the same cell, and the problem is gone. I've ran into this before, and am sure I will again, so have made this work-around a mental note for now. If anyone comes-up with some understanding as to what's going-on, I'd love to hear from you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
align vertically, cell, top

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down menu alignment problems. Div wont vertically align. Itsumishi Web Page Design 7 Mar 4th, 2008 04:57
vertically center text alexgeek Web Page Design 2 Aug 14th, 2007 12:47
Align text vertically in a box josoap Web Page Design 3 Jul 12th, 2007 17:29
Rotating vertically grizzlyman Starting Out 2 Apr 7th, 2007 19:46
centering vertically benbacardi Web Page Design 17 May 27th, 2004 13:51


All times are GMT. The time now is 21:38.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42