Solved

Aligning Table Data - Top

Posted on 2002-03-14
10
210 Views
Last Modified: 2010-04-09
It seems simple enough, but, everthing I try, comes out Centered, sigh.. any help? basically, the data always ends up in the middle, can it be aligned to the top, like in an excel cell??

Here's my table, well, at least the first table row.

<b>Class of Construction</b><P>

<table width="100%" border="1" cellspacing="1" cellpadding="1">
     <tr>
       <td>
         Class
       </td>
     
       <td>
         Description
       </td>

       <td>
         Frame
       </td>

       <td>
         Floor
       </td>

       <td>
         Roof
       </td>

       <td>
         Walls
       </td>
     </tr>        

     <tr>
       <td>
         A          
       </td>

       <td>
               Class A buildings have fireproofed structural steel frames with reinforced          

          concrete or masonry floors and roofs.<P>

              These are typically high-rise or heavy industrial type buildings. (Offices,      

            Hotels, Apartment & Condos)
        </td>

       <td>
              Structural steel columns and beams, fireproofed with masonry, concrete
              plaster, or other non-combustible material
       </td>

       <td>
              Concrete or concrete on steel deck foreproofed.
       </td>

       <td>
              Formed concrete, pre-cast slabs, concrete or gypsum on steel deck,                  

     fireproofed.
       </td>

       <td>
          Nonbearing curtain walls, masonry, concrete, metal and glass panels, stone, steel

          studs and masonry, tile or stucco, etc.
       </td>
     </tr>

</table>


Thanks in advance... if this is more than a 50 point question, please let me know, I will gladly upgrade..

nfroio
0
Comment
Question by:nfroio
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 5

Author Comment

by:nfroio
ID: 6866387
Well, got it sorted, guess that you have to valign=top, all table data records before it takes effect.. sigh.. its been a really, really long day, and i have been working on this super long form for over 7 hours straight..

thanks all..

nfroio
0
 
LVL 30

Expert Comment

by:third
ID: 6866607
if you're formatting valign top for the whole row, you can set it once it the <tr> tag.

so instead of using,
<tr>
  <td valign="top">&nbsp;</td>
  <td valign="top">&nbsp;</td>
  <td valign="top">&nbsp;</td>
</tr>

u can use,

<tr valign="top">
  <td>&nbsp;</td>
  <td>&nbsp;</td>
  <td>&nbsp;</td>
</tr>

much easier and neat isn't it?

"take a rest, your mind needs it..."
0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 50 total points
ID: 6867141
you can make your life even easier with CSS for the newer browsers

<style>
td {vertical-align:top;}
</style>

and you don't have to write the attribute for every td or tr element
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6867528
third,

Are you sure that <tr valign="top"> works in all browsers? I seriously believe it will give troubles in Netscape versions 4..

Max.
0
 
LVL 30

Expert Comment

by:third
ID: 6867585
i haven't seen on my comment above stating that it works on all browsers. besides it doesn't give only trouble in NS4 but NS6.2 as well. haven't tried on NS6 but most probably since it doesn't work on NS6.2 it wont work i believe.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Author Comment

by:nfroio
ID: 6868006
Thanks guys, I will look into those two options, as I have two huge tables to work on, and either of those will save me time...

As for Netscrap compatibility, no need, all of the folks in our offices use IE...

thanks again...  will be back...

nfroio
0
 
LVL 5

Author Comment

by:nfroio
ID: 6868419
b1xml2,

I am not familiar w/ CSS, where would I insert that Style tag? Before the rows that I want the text to be positioned on the top? If I use that tag, can I still use the <td valign=center> tag option for the first header row??

Thanks,

nfroio
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 6876013
style tags will go in the <head> portion like this:


<html>
  <head>
    <style>
      *********
      *********
      *********
    </style>
  </head>

  <body>

  </body>
</html>
lhn
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 6876289
so now i think ill post the complete code you could ever need.

<style>
table{vertical-align:top;}
td{vertical-align:top;}
tr{vertical-align:top;}
th{vertical-align:top;}
</style>
0
 
LVL 5

Author Comment

by:nfroio
ID: 6877925
b1xml2,

thank you for the tip, i have decided to use CSS tags and it has helped me immensely, finally finished up that form, and it looks great...


nfroio
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Urgent Help with HTML CSS Positioning 9 41
Modify Table Width 6 22
Sums of coloumns in html/java 15 65
How to hide the rows in Table when the value is empty ? 4 12
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now