How to use spaces in template text?
P粉135292805
2023-09-01 23:51:08
<p>I have a <code><li></code> element that uses a <em>template literal</em> (template string) to display dynamic content. </p>
<pre class="brush:php;toolbar:false;"><li className='floatLeft'><span><b>Galley Details</b></span> <br/ >{`${galleyCartsDet[0].quantity} Full Cart ${galleyCartsDet[1].quantity} Half Cart${galleyCartsDet[2].quantity} SMU${galleyCartsDet[3].quantity} Stowage`}< /li></pre>
<p>How to use spaces in a given template string? </p>
<pre class="brush:php;toolbar:false;">`${galleyCartsDet[0].quantity} Full Cart ${galleyCartsDet[1].quantity} Half Cart${galleyCartsDet[2].quantity} SMU ${galleyCartsDet[3].quantity} Stowage`</pre></p>
You can use spaces in template strings in the following ways:
\u00A0
= non-breaking spaces\u0020
= Normal space