GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Mar-2003, 11:24
Charlie Charlie is offline
New Member
 
Join Date: May 2002
Location: Minnesota, USA
Posts: 24
Charlie is an unknown quantity at this point

top of table


In a two-column table, when one column is really long, the text in the other goes in the middle (vertically). This is normally good, however in one case I need the text in one column to stay at the TOP instead of going to the middle because the other text is huge. How can I do this?
  #2  
Old 25-Mar-2003, 12:05
pcxgamer's Avatar
pcxgamer pcxgamer is offline
Senior Member
 
Join Date: Sep 2002
Location: South Carolina, USA
Posts: 1,095
pcxgamer is a jewel in the roughpcxgamer is a jewel in the roughpcxgamer is a jewel in the rough
Hello Charlie,

Ok its been a long time since I've played with tables. But I put together this code let me know if this is want your talking about.
HTML Code:
<html> <body> <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0> <TR ALIGN=left VALIGN=top> <TD WIDTH=200 rowspan=2>row 1, column 1</TD> <TD WIDTH=100>row 1, column 2</TD> </TR> <TR ALIGN=left VALIGN=top> <TD> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0> <TR> <TD>Cell 1</TD> </TR> </TABLE> </body> </html>

if this is wrong let me know.
__________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
  #3  
Old 25-Mar-2003, 14:32
pcxgamer's Avatar
pcxgamer pcxgamer is offline
Senior Member
 
Join Date: Sep 2002
Location: South Carolina, USA
Posts: 1,095
pcxgamer is a jewel in the roughpcxgamer is a jewel in the roughpcxgamer is a jewel in the rough
ok I was work on the web today and I found that if you just add
valign="top" to the TD tag then it should put it on top. Just make sure that its the TD tag for the cell that has the text in it.
Hope this helps.
__________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
  #4  
Old 25-Mar-2003, 14:59
Charlie Charlie is offline
New Member
 
Join Date: May 2002
Location: Minnesota, USA
Posts: 24
Charlie is an unknown quantity at this point
Thanks so much! Works like a charm
  #5  
Old 25-Mar-2003, 15:00
pcxgamer's Avatar
pcxgamer pcxgamer is offline
Senior Member
 
Join Date: Sep 2002
Location: South Carolina, USA
Posts: 1,095
pcxgamer is a jewel in the roughpcxgamer is a jewel in the roughpcxgamer is a jewel in the rough
Your Welcome.
__________________
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
  #6  
Old 25-Mar-2003, 15:50
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
Another satisfied customer...:-D
  #7  
Old 26-Mar-2003, 03:25
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Using CSS to align a (table) cell or cells to the top


For those of you who will find this thread in the future and may be interested in the XHTML / CSS version of the solution -

First the CSS between the <head> and </head> tags:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CSS and 'vertical-align:top' property</title> <style type="text/css"> <!-- .Align2Top { vertical-align:top } --> </style> </head>

Now, anywhere you want all the table data (cells) in a table row to vertically align to the top:
HTML Code:
<body> <table> <tr class="Align2Top"> <td style="width:33%"> <p>CSS and XHTML are the future.</p> <p>CSS and XHTML are the future.</p> <p>CSS and XHTML are the future.</p> </td> <td style="width:33%"> <p>The XHTML specification does not recommend the use of the 'valign' attribute; you should use CSS instead.</p> <p>The XHTML specification does not recommend the use of the 'valign' attribute; you should use CSS instead.</p> </td> <td style="width:33%"> <p>pcxgamer is da Man!</p> </td> </tr> </table> </body>

If you only want 1 table data (cell) to be aligned to the top:
HTML Code:
<body> <table> <tr> <td style="width:33%"> <p>CSS and XHTML are the future.</p> <p>CSS and XHTML are the future.</p> <p>CSS and XHTML are the future.</p> </td> <td style="width:33%"> <p>The XHTML specification does not recommend the use of the 'valign' attribute; you should use CSS instead.</p> <p>The XHTML specification does not recommend the use of the 'valign' attribute; you should use CSS instead.</p> </td> <td style="width:33%" class="Align2Top"> <p>pcxgamer is da Man!</p> </td> </tr> </table> </body>

pcxgamer, I want to thank you for reminding me about html tags in UPPERCASE, now the HTML bbcode will recognise them too...
  #8  
Old 27-Mar-2003, 03:21
conkermaniac conkermaniac is offline
Member
 
Join Date: Dec 2001
Location: China
Posts: 174
conkermaniac is on a distinguished road
Hi Charlie,

I used to have the same problem (I'm not exactly an HTML expert -- I only know the basics, and I have to look the rest up), and I discovered that valign="top" works by testing it out in Frontpage, actually. So yes, there are uses for that evil tool.
__________________
You're not supposed to be looking at this.
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to retrieve selective results from a table. icsys MySQL / PHP Forum 9 18-Nov-2003 04:31
form in a table cell blelisa Web Design Forum 1 19-Aug-2003 10:14
[Tutorial] MySQL Basics nniehoff MySQL / PHP Forum 15 23-Mar-2003 20:42
using a button to change table contents. demtro MySQL / PHP Forum 20 02-Mar-2003 16:07
table question smoky Web Design Forum 1 05-Jan-2003 03:45

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:49.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.