How to preserve whitespace in dynamically added javascript DOM element without using CSS?

前端 未结 4 1574
傲寒
傲寒 2020-12-20 18:06

When adding in text with small whitespace appended to it for alignment purposes the whitespace is trimmed off (the whitespace is added in c# so by the time it gets to front

4条回答
  •  心在旅途
    2020-12-20 18:21

    use a html tag 'pre'

    Example:

    A line
       A line with indent
    

    result:

    A line
       A line with indent
    

提交回复
热议问题