SirChick Posted November 1, 2007 Share Posted November 1, 2007 I have a while loop that im trying to echo infomation horizontally rather than downwards. Downwards is pretty easy cos i just use </br> but i want to space the echo's out horizontally by X amount yet i cant use div's cos then they will be the same height rather than the second row of the while loop being below it.. this is what i tried: $Getcars = mysql_query("SELECT * FROM cars WHERE UserID='{$_SESSION['Current_User']}'") or die(mysql_error()); // Fetch the row from the database if(mysql_num_rows($Getcars) != 0){ echo'<div id="bv_" style="position:absolute;left:50px;top:450px;width:450px;height:22px;z-index:1" align="left">'; while($row = mysql_fetch_array($Getcars)) { $CarName = $row['CarName']; $FuelLeft = $row['FuelLeft']; Echo'<font style="font-size:14px" color="#FFFFFF" face="Arial"><b>';echo$CarName; Echo' ';Echo$FuelLeft; As you can see above i put a Echo' '; of open space but on the page it still comes up right next to car name like: Car Name Fuel Left Nissan 100 I need it to be like : Car Name Fuel Left Nissan 100 Quote Link to comment https://forums.phpfreaks.com/topic/75698-solved-help-with-while-loop-echo-positions/ Share on other sites More sharing options...
Cagecrawler Posted November 1, 2007 Share Posted November 1, 2007 html automatically shrinks a line of whitespace down to only one space. You need to do this: <?php Echo' ';Echo$FuelLeft; ?> Quote Link to comment https://forums.phpfreaks.com/topic/75698-solved-help-with-while-loop-echo-positions/#findComment-383046 Share on other sites More sharing options...
SirChick Posted November 1, 2007 Author Share Posted November 1, 2007 ; what is that? Quote Link to comment https://forums.phpfreaks.com/topic/75698-solved-help-with-while-loop-echo-positions/#findComment-383048 Share on other sites More sharing options...
Neptunus Maris Posted November 1, 2007 Share Posted November 1, 2007 ; what is that? Yeah...what is that? Quote Link to comment https://forums.phpfreaks.com/topic/75698-solved-help-with-while-loop-echo-positions/#findComment-383050 Share on other sites More sharing options...
Cagecrawler Posted November 1, 2007 Share Posted November 1, 2007 is the html code for a non-breaking space. Normally HTML will truncate spaces in your text. If you write 10 spaces in your text HTML will remove 9 of them. To add spaces to your text' date=' use the character entity.[/quote'] Quote Link to comment https://forums.phpfreaks.com/topic/75698-solved-help-with-while-loop-echo-positions/#findComment-383052 Share on other sites More sharing options...
Zane Posted November 2, 2007 Share Posted November 2, 2007 i cant use div's try using padding-right for your spacing or margin-right Quote Link to comment https://forums.phpfreaks.com/topic/75698-solved-help-with-while-loop-echo-positions/#findComment-383253 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.