How to use spaces in template text?
P粉135292805
P粉135292805 2023-09-01 23:51:08
0
1
495
<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>
P粉135292805
P粉135292805

reply all(1)
P粉130097898

You can use spaces in template strings in the following ways:

`\u00A0\u00A0${option.value}\u00A0\u00A0`

\u00A0 = non-breaking spaces
\u0020 = Normal space

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template