javascript HTML 中的制表符空间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14290379/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 21:14:24  来源:igfitidea点击:

Tab space in HTML

javascripthtmlextjs

提问by Sumon Bappi

I want to use a tab space in my string. I am providing the code of using new line. But I don't know how to use a tab space in a string. Can anyone help me on this !?

我想在我的字符串中使用制表符空间。我正在提供使用新行的代码。但我不知道如何在字符串中使用制表符空间。谁可以帮我这个事 !?

"Warning ! Sorry Cash Pay is less than this  <br/> month\'s installment. Please pay the  <br/> right amount."

回答by Shiplu Mokaddim

&#09;is TAB character in ASCII. But according to html spec all white space characters will be stripped to a single character. There are other white space characters too. Like &thinsp;, &emsp;and &ensp;You can try them too.

&#09;是 ASCII 中的 TAB 字符。但根据 html 规范,所有空白字符都将被剥离为单个字符。还有其他空白字符。像&thinsp;&emsp;并且&ensp;你可以试试他们。

Update

更新

It seems &emsp;gives a spacing of tab size. See the following

它似乎&emsp;给出了标签大小的间距。请参阅以下内容

  • a&emsp;brendered as a b
  • a&ensp;brendered as a b
  • a&thinsp;brendered as a b
  • a&nbsp;brendered as a b
  • a&#09;brendered as a b
  • a&emsp;b呈现为b
  • a&ensp;b呈现为b
  • a&thinsp;b呈现为b
  • a&nbsp;b呈现为b
  • a&#09;b呈现为b