Solved

Aligning Table Data - Top

Posted on 2002-03-14
10
217 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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
 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

803 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