brown2005 Posted March 6, 2007 Share Posted March 6, 2007 currently I have echo"<table width='1000' border='0' cellspacing='0' cellpadding='0' height='100%'>"; echo" <tr> <td width='840' valign='top'>"; include('main.php'); echo" </td> <td width='160' valign='top' height='100%'>"; include('sponsors.php'); echo" </td> </tr>"; echo"</table>"; and i want to replace it with <div> can nebody help please? Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/ Share on other sites More sharing options...
tarun Posted March 6, 2007 Share Posted March 6, 2007 ...Well You Could Mayby Use The DIV And Float Check This Out: http://css.maxdesign.com.au/floatutorial/ Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-200903 Share on other sites More sharing options...
TheFilmGod Posted March 19, 2007 Share Posted March 19, 2007 You are right, everybody now says to have div tags instead of pure tables for their website designs. But I'll tell you, it doesn't matter. As long as it looks like you want it to look like, you are good. That's what I'm sticking to, at least for a while! Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-210316 Share on other sites More sharing options...
fredb Posted March 21, 2007 Share Posted March 21, 2007 I'm not sure exactly how you want this aligned, but this will start your page at an absolute 0,0 position in the upper left corner. echo "<div id="Main" style="position:absolute; left:0; top:0; width:840px;">"; include('main.php'); echo "</div><div id="Sponsors" style="position:absolute; left:840px; top:0; width:124px; z-index:1">"; include('sponsors.php'); echo "</div>"; I am php noob, so as far as the php involved in that code, I just used what you wanted. The DIV tags will get you done though. -Fred Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-212370 Share on other sites More sharing options...
fredb Posted March 21, 2007 Share Posted March 21, 2007 Ugh, I just realized I typo'd on the width of one of the DIVs echo "</div><div id="Sponsors" style="position:absolute; left:840px; top:0; width:124px; z-index:1">"; Should be: echo "</div><div id="Sponsors" style="position:absolute; left:840px; top:0; width:160px; z-index:1">"; To reflect the correct width you specified above. Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-212416 Share on other sites More sharing options...
ToonMariner Posted March 22, 2007 Share Posted March 22, 2007 You are right, everybody now says to have div tags instead of pure tables for their website designs. But I'll tell you, it doesn't matter. As long as it looks like you want it to look like, you are good. That's what I'm sticking to, at least for a while! For shame!!!! The extraneous markup required to achieve your layout with a table can VASTLY increase the download time for your page. Site maintainence is also MUCH more complicated with a table based layout (especially if you have lots of nested tables). I guarantee spending a few days spent switching one of your sites from tables to table-less will be the most rewarding and beneficial few days you will ever spend in the world of site construction. I think many are put off thinking it will be hard and stick with what they know - but once you realise that not only is it actually easier to construct pages faster and more efficiently but you will find better ways to segregate content and manage your site much more easily. Rant over.... Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-212661 Share on other sites More sharing options...
dustinnoe Posted March 27, 2007 Share Posted March 27, 2007 I guarantee spending a few days spent switching one of your sites from tables to table-less will be the most rewarding and beneficial few days you will ever spend in the world of site construction. Not to mention that Search engines navigate a site much better when it is marked up semantically. There are almost to many benefits to list. Plus you can participate in <a href="http://naked.dustindiaz.com/">Naked day</a> and look good doing it. Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-215977 Share on other sites More sharing options...
ToonMariner Posted March 27, 2007 Share Posted March 27, 2007 My boss has agreed to join the naked day (really should do my own site sometime soon). Anyway I am about to add a count me in message at the bottom of your naked day page.... Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-216052 Share on other sites More sharing options...
dustinnoe Posted March 27, 2007 Share Posted March 27, 2007 My boss has agreed to join the naked day (really should do my own site sometime soon). Anyway I am about to add a count me in message at the bottom of your naked day page.... You got the wrong Dustin but that's OK. I have forwarded your request to participate on to <a href="http://www.dustindiaz.com">Dustin Diaz</a>, the mastermind behind naked day. Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-216426 Share on other sites More sharing options...
dustinnoe Posted April 1, 2007 Share Posted April 1, 2007 Anyone wishing to sign up for naked day can follow this link. http://naked.dustindiaz.com/#signup Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-219038 Share on other sites More sharing options...
TheFilmGod Posted April 8, 2007 Share Posted April 8, 2007 You are right, everybody now says to have div tags instead of pure tables for their website designs. But I'll tell you, it doesn't matter. As long as it looks like you want it to look like, you are good. That's what I'm sticking to, at least for a while! For shame!!!! The extraneous markup required to achieve your layout with a table can VASTLY increase the download time for your page. Site maintainence is also MUCH more complicated with a table based layout (especially if you have lots of nested tables). I completely disagree. Using a table doesn't "vastly"' increase download time. A few kb won't harm the visitor. I don't know what host you are using. About site maintainence, that really depends. If you are using php include pretty much every where changing the whole layout would be mad easy. But for someone who sticks with static html then div tags are the way to go! Quote Link to comment https://forums.phpfreaks.com/topic/41446-help-replacing-table-with-a-div/#findComment-224189 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.