Monkling Posted August 22, 2006 Share Posted August 22, 2006 I am trying to format a website with 2 columns. I've tried both CSS and using tables and, in both cases, it only shows the left column & not the right column. The CSS attempt:[code]echo"<div style=\"float: left; width: 20%; padding: 5px;\">";include ("blogarchive.php"); echo"</div><div style=\"float:right; width: 75%; padding: 5px;\">"; include ("index.php"); echo"</div>";[/code]The table attempt:[code]echo"<table width=\"100%\" border=\"1\" padding=\"5\">";echo"<tr><td width=\"20%\">"; include ("blogarchive.php"); echo"</td><td width=\"80%\">"; include ("index.php"); echo"</td></tr></table>";[/code]Both of these php files work fine and contain no CSS styling of their own. I'm probably missing something really simple but I can't figure out why I can't get this to work. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/18303-php-formatting-problem/ Share on other sites More sharing options...
ober Posted August 22, 2006 Share Posted August 22, 2006 When you say it doesn't show the right column... do you mean that it just comes up as a white page or it messes up the actual layout? If you include the index.php file by itself, does it actually work? Quote Link to comment https://forums.phpfreaks.com/topic/18303-php-formatting-problem/#findComment-78654 Share on other sites More sharing options...
Monkling Posted August 22, 2006 Author Share Posted August 22, 2006 I mean all that shows up is the file [i]blogarchive.php[/i]. With the CSS code, that is on the left & the right side of the page is blank. With the table columns, there is just one column with that same [i]blogarchive.php[/i] file. The [i]index.php[/i] file works perfectly fine on it's own. I've tried putting different php files into the right side & nothing shows up. Quote Link to comment https://forums.phpfreaks.com/topic/18303-php-formatting-problem/#findComment-78858 Share on other sites More sharing options...
Monkling Posted August 28, 2006 Author Share Posted August 28, 2006 Does anyone have a clue why I'm having problems using [i]include [/i]with CSS?I've been experimenting with everything I can think of. It seems if I do something simple like:[code]<div style="float: left; width: 20%; padding: 5px;"><?php echo "This is the left column."; ?> </div> <?php echo "And this should show up to the right of the other text"; ?>[/code]It works as expected.But when I substitute that first php code (the one between the div tags) with an [i]include[/i] rather than an [i]echo [/i]statement, it ignores anything that comes after it. Quote Link to comment https://forums.phpfreaks.com/topic/18303-php-formatting-problem/#findComment-81444 Share on other sites More sharing options...
AndyB Posted August 28, 2006 Share Posted August 28, 2006 Sounds as though the problem lies with what you're including, i.e. something in your include is terminating output from the script. Quote Link to comment https://forums.phpfreaks.com/topic/18303-php-formatting-problem/#findComment-81471 Share on other sites More sharing options...
Monkling Posted August 28, 2006 Author Share Posted August 28, 2006 [quote author=AndyB link=topic=105189.msg423176#msg423176 date=1156744138]something in your include is terminating output from the script.[/quote]AH!! A lightbulb just went off in my head. I used [i]exit [/i]in that script. Must be that. Now if I could only get it to work without using [i]exit[/i]. Back to the drawing board...Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/18303-php-formatting-problem/#findComment-81668 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.