Solved

Why do multiple tables alilgn horizontally and not vertically?

Posted on 2008-10-03
4
521 Views
Last Modified: 2010-04-21


I'm trying to be a better steward  on using CSS & HTML more effectively. On my html page, I have several tables that are supposed to align vertically along the left size.  But, they all "kick-out" to the right.  How do I make the tables align vertically?

Thanks
&
"red faced"
0
Comment
Question by:IT79637
4 Comments
 
LVL 16

Accepted Solution

by:
rbudj earned 100 total points
ID: 22638052
the only way to get multiple tables to line up horizontally is to place them into their own <td>'s within a main table.  Tables cannot naturally line up horizontally so if you simply place multiple tables one right after another they will line up horizontally.  

Posting your code will allow for better troubleshooting.
0
 
LVL 18

Assisted Solution

by:Hube02
Hube02 earned 100 total points
ID: 22638195
Another reason that they may line up horizontally is if you have them floating on the left (or the right). This can be done in HTML with:

<table align="left">

or in CSS with:

table {
  float: left;
}

Again, if you post your code someone will be able to diagnose your specific issue.
0
 
LVL 44

Assisted Solution

by:scrathcyboy
scrathcyboy earned 100 total points
ID: 22638947
It you are declaring separate tables, as I always do in most of my sites, there are 2 ways to align them --

1.  you can put a master table around everything in the page, and under the one TD, put all your subtables -- this is already mentioned above.  I have found that is not the most flexible way to do things. so I do this --

2.  Just set the parameters the same for each table in sequence --

<TABLE width="780">
<TR>
<TD width= "10">  </TD>
<TD width="550" >  </TD>                           <-- this if for your text
<TD width="200">  </TD>                            <-- this is for an image
<TD width="10">  </TD>
</TR>
</TABLE

 Now just put all tables with the same parameters down the page, and they will all line up, assuming you do not have images that are too big in one table versus the other.

If you are trying to go with a PERCENT size layout for your screen, you will find this will NEVER work.

If you must have everything resize to the browser size, then go with TABLE-LESS layout and use DIVs as they work better for scalable width than do tables/
0
 
LVL 1

Author Closing Comment

by:IT79637
ID: 31502908
All answers had valuable information.  I finally went with defining a table with a "master" table with one row and column and dumped my tables inside the "master" table.  It's ugly, but expedient.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

821 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