pneudralics Posted March 23, 2006 Share Posted March 23, 2006 Is there to make a table that's simliar to css's float: left and float: right?I want to make to columns on the page and have a left and right column that I can add bunch of tables on one side and vice versa.Any tutorials? Quote Link to comment https://forums.phpfreaks.com/topic/5625-aligning-tables/ Share on other sites More sharing options...
Gast Posted March 24, 2006 Share Posted March 24, 2006 Well a simple table that would have a header and then a navigation column and a main content area, that would look like:[code]+----------------+| |+----+-----------+| | || | || | || | || | || | || | |+----+-----------+[/code]You would use the code:[code]<table width="760" border="0" cellpadding="5" cellspacing="0"> <tr> <td colspan="2"> Header content here </td> </tr> <tr> <td width="25%"> Navigation here </td> <td width="75%"> Main content </td> </tr></table>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/5625-aligning-tables/#findComment-20309 Share on other sites More sharing options...
knokkel Posted April 23, 2006 Share Posted April 23, 2006 you'll want to use valign="top" align="right"in both TD's for content and menu to align the text to the top of the table cell.. otherwise it will automatically center the text.. Quote Link to comment https://forums.phpfreaks.com/topic/5625-aligning-tables/#findComment-29797 Share on other sites More sharing options...
Yesideez Posted April 23, 2006 Share Posted April 23, 2006 If you want a column on the left and the right use something like this:[code]<table width="100%" border="1"> <tr><td colspan="3">This is the title bar</td></tr> <tr> <td valign="top">LEFT COLUMN</td> <td valign="top">MIDDLE COLUMN</td> <td valign="top">RIGHT COLUMN</td> </tr></table>[/code]Change border to 0 when you are happy. Having [b]valign="top"[/b] makes sure that the contents of each column are aligned to the top.Just replace the above text showing each column with more table declarations, hope its what you were asking for :) Quote Link to comment https://forums.phpfreaks.com/topic/5625-aligning-tables/#findComment-29906 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.