Jump to content

add a space in a echo statement


kat35601

Recommended Posts

 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

 

 

Link to comment
Share on other sites

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 by Psycho
Link to comment
Share on other sites

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.