having tables side by side
i am having some nested table where by i have many tables in one big table this way:
i want the table1 and table2 to be arranged side by side. but from the code i am having above, the table1 is shown with a line break. which means, table1 is on top of table2. i don't want it this way as i needed it to be side by side. how could i do that?
<table name="table1"><tr><td> </td></tr></table>
<table name="table2"><tr><td> </td></tr></table>
If you just want two columns (which is what that code would make) then you only really need one table. If you are wanting to style the big table, then use a div instead. Dont add extra 'junk' tags where they arent needed. Strictly speaking, you shouldnt need to use tables at all to do a layout, you can use <div> 's to define the sections, then use CSS to place those wherever you like.
That makes it a lot easier to update too, since your HTML will only have content in, and the design will all be in the CSS. So yuo can change one, without having to ever see the other.
EDIT to add: here is how you could do the columns thing:
then either link in some CSS, or put it in the head...
<p>Left column content here</p>
<p>Right column content here</p>
//sets all padding and margins to 0 to help you position your elements
//style everything in your content - this would be the equivalent of your 'bigtable'
//position so the divs are next to each other
//add styling for yout left column
//then add styling for the right column
Last edited by abz; 10-22-2006 at 08:20 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)