kat35601 Posted November 4, 2014 Share Posted November 4, 2014 I want to add a space after $item in the below statement so that there is more space between the output of Item and Qty. echo "<tr><td>$Item </td>"; echo "<td>$Qty</td></tr>"; example 245-01 1 345-97 17 212-11 3 would become 245-01 1 345-97 17 212-11 3 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/292267-add-a-space-in-a-echo-statement/ Share on other sites More sharing options...
ginerjm Posted November 4, 2014 Share Posted November 4, 2014 As you know you can't have double spaces in html. I suggest you use css to pad that cell. Quote Link to comment https://forums.phpfreaks.com/topic/292267-add-a-space-in-a-echo-statement/#findComment-1495695 Share on other sites More sharing options...
Ch0cu3r Posted November 4, 2014 Share Posted November 4, 2014 Or apply a width to your table columns Quote Link to comment https://forums.phpfreaks.com/topic/292267-add-a-space-in-a-echo-statement/#findComment-1495696 Share on other sites More sharing options...
Psycho Posted November 4, 2014 Share Posted November 4, 2014 (edited) As you know you can't have double spaces in html. I suggest you use css to pad that cell. While I agree that CSS is the appropriate solution, the statement above is not 100% accurate. You can use non-breaking consecutive spaces and they will all be rendered by the browser. As opposed to normal consecutive spaces that are rendered as a single space. Edited November 4, 2014 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/292267-add-a-space-in-a-echo-statement/#findComment-1495697 Share on other sites More sharing options...
Stielle Posted December 7, 2014 Share Posted December 7, 2014 If you simply just want extra spaces, do this: echo "<tr><td>$Item </td>"; echo "<td>$Qty</td></tr>"; Quote Link to comment https://forums.phpfreaks.com/topic/292267-add-a-space-in-a-echo-statement/#findComment-1498849 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.