Solved

Why do multiple tables alilgn horizontally and not vertically?

Posted on 2008-10-03
4
531 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
close pop up windows when logout or main window closes 17 82
Increase image taller on inner pages 2 45
Insert PHP into HTML page. 7 43
SSL unsecure page mystery 17 38
This article discusses four methods for overlaying images in a container on a web page
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

740 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