Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Why do multiple tables alilgn horizontally and not vertically?

Posted on 2008-10-03
4
Medium Priority
?
551 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 400 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 400 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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
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 tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

722 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