Can I set up tab stops in html5?

后端 未结 6 1575
北海茫月
北海茫月 2021-02-13 03:10

I would like to set up tab stops in html5 and be able to align text to them, just like in Word. For my application I can\'t use tables. Is there a way to do this? Do I have t

6条回答
  •  滥情空心
    2021-02-13 03:49

    Despite the assertions of the other posters to the contrary, there are valid reasons to want to do what the OP asked and many ways to do it using modern CSS (and more in the draft specification process as I write this). Here is just one way.

    
    
     
      Tabs with css
      
     
     
      
    first row data before first tabdata left aligned with first tabdata aligned with second tab

    second row data before first tabdata left aligned with first tabdata aligned with second tab

    third row data before first tabdata left aligned with first tabdata aligned with second tab

    fourth row data before first tabdata left aligned with first tabdata aligned with second tab

    fifth row data before first tabdata left aligned with first tabdata aligned with second tab

    See sample results here: http://jsfiddle.net/Td285/

    Another example, with overflow clipped: http://jsfiddle.net/KzhP8/

提交回复
热议问题