How to insert spaces/tabs in text using HTML/CSS

后端 未结 18 2653
死守一世寂寞
死守一世寂寞 2020-11-28 01:20

Possible ways:

 ... 

or

style=\"white-space:pre\"

Anything else?

18条回答
  •  庸人自扰
    2020-11-28 02:02

    user8657661's answer is closest to my needs (of lining things up across several lines). However, I couldn't get the example code to work as provided, but I needed to change it as follows:

    
        
            
        
    
        
            Dog Food:  $30
    Milk of Magnesia: $30
    Pizza Kit: $5
    Mt Dew $1.75

    If you need right-aligned numbers you can change left:150px to right:150px, but you'll need to alter the number based on the width of the screen (as written the numbers would be 150 pixels from the right edge of the screen).

提交回复
热议问题