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

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

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

\"enter

UPD. As you

11条回答
  •  滥情空心
    2021-02-02 11:25

    To achieve that alignment, you should do something like this:

    HTML:

    
        
    12345

    CSS:

    .my_td 
    {
        width: 200px;
        align: center;
    }
    
    .content
    {
        width: 100px;
        margin-left: auto;
        margin-right: auto;
        text-align: right;
    }
    

    You just need to adapt the widths to meet your requirements, for instance, max digits in the number.

提交回复
热议问题