search

Home  >  Q&A  >  body text

JS中如何输出空格?

checkcheck2905 days ago911

reply all(3)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:16:12

    How to output spaces in JS? -PHP Chinese website Q&A-How to output spaces in JS? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 阿神

    阿神2016-12-21 09:37:23

      document.write("<span style='white-space:pre;'>"+"  1        2    3    "+"</span>");
     结果:  1       2     3 

    reply
    0
  • 迷茫

    迷茫2016-12-21 09:36:27

    使用输出html标签&nbsp;来解决

     document.write("&nbsp;&nbsp;"+"1"+"&nbsp;&nbsp;&nbsp;&nbsp;"+"23");
     结果:  1    23


    reply
    1
  • Cancelreply