Link to home
Start Free TrialLog in
Avatar of nfroio
nfroioFlag for United States of America

asked on

Aligning Table Data - Top

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
Avatar of nfroio
nfroio
Flag of United States of America image

ASKER

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
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..."
ASKER CERTIFIED SOLUTION
Avatar of b1xml2
b1xml2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DreamMaster
DreamMaster

third,

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

Max.
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.
Avatar of nfroio

ASKER

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
Avatar of nfroio

ASKER

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
style tags will go in the <head> portion like this:


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

  <body>

  </body>
</html>
lhn
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>
Avatar of nfroio

ASKER

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