www.webdeveloper.com
Results 1 to 2 of 2

Thread: Page positioning

  1. #1
    Join Date
    Sep 2009
    Posts
    51

    Page positioning

    Hi,

    I am having problem lining up some elements.
    I have a page with several tables, and each table may or may not have a chart (flash object next to it).

    All the tables to be one under another, aligned to the left, and each chart to be immediately to the right of its respective table:

    ________ __________
    | | | |
    | Table1 | | graph1 |
    | | | |
    |________| |_________|

    ________ __________
    | | | |
    | Table2 | | graph2 |
    | | | |
    |________| |_________ |

    ________ __________
    | | | |
    | Table3 | | graph3 |
    | | | |
    |________| |_________|

    My HTML markup goes like this:

    HTML Code:
    <div class="reportArea">
    	<div class="tableSection">
    		<table>
                              ....
    		</table>
    	</div>
    </div>
    
    <div class="reportArea">
            <div class="tableSection">
    		<table>
                                ....
    		</table>
    	</div>
    	<div class="chartSection" id=".."> 
    		<object>
                                ....
                    </object>
    	</div>
    </div>
    My css is like this:

    Code:
    div.reportArea
    {
    	width: 100%;
    	padding-top: 20px;
    }
    
    div.tableSection
    {
    	float: left;
    	width: 50%;
    }
    
    div.chartSection
    {
    	width: 50%;
    }
    The problem is that it doesn't work in any of the browsers except for IE.
    Opera doesn't respond at all to the style - just stacking all the divs one under the other.
    Safari, Chrome, and FireFox produce a layout where table2 which is supposed to be in the second row, is actually on the right of table1, half way up its height, and graph2 is aligned to the left..

    Sorry, didn't know how to present it graphically.


    Could someone please suggest what I am doing wrong, and what the proper way to achieve the "table-like" alignment is?

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    div.reportArea
    {
    	width: 100&#37;;
    	padding-top: 20px;
    }
    
    div.reportArea table, div.reportArea object
    {
    	float: left;
    	width: 50%;
    }
    Code:
    <div class="reportArea">
        <table>
        ....
        </table>
        <object>
        ....
        </object>
    </div>
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles