How to center right-aligned numbers in table column using CSS?

前端 未结 11 2133
傲寒
傲寒 2021-02-02 10:54

The picture below illustrates what I\'m trying to accomplish:

\"enter

UPD. As you

11条回答
  •  无人共我
    2021-02-02 11:43

    Below is not an ideal solution, since the size of the numbers are initially unknown, but it's a little closer without too much additional tags.

    CSS:

    .numSpan {
        display: inline-block;
        width: 100px;
        text-align: right;
    }
    td { text-align: center; }
    

    HTML:

    
        5
    
    

提交回复
热议问题