Solved

Aligning Table Data - Top

Posted on 2002-03-14
10
198 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
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…
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 …

708 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