Right align and left align text in same HTML table cell

前端 未结 8 1489
梦谈多话
梦谈多话 2020-12-08 03:52

I have a cell in an HTML

. I would like part of the cell contents to be left justified and part to be right justified. Is this possible?

8条回答
  •  时光取名叫无心
    2020-12-08 04:27

    I came up with this while trying to figure out how to display currency ('$' to left, number to right) in table cells:

    20.34
    .currency { text-align: right; } .currency:before { content: "$"; float: left; padding-right: 4px; }

提交回复
热议问题