Two columns table : one as small as possible, the other takes the rest

前端 未结 3 471
渐次进展
渐次进展 2021-02-06 21:12

I have a to-columns table in a div :

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-06 21:19

    Giving the content td a 100% width will force it to take as much space as it can, so .content{ width: 100% } should work.

    Also give the .action a white-space: nowrap to make sure the x and the checkmark stay next to each other. Otherwise the content will be able to take even more space and force the icons below each other.

    table .action
    {
        width:auto;
        text-align:right;
        white-space: nowrap
    }
    table .content { 
        width: 100% 
    }
    table 
    {
        border-collapse:collapse;
        border-spacing:0;
        width:100%;
        border: 1px solid
    }

    Bigger text...(variable size).......

    Bigger text...(variable size).......

提交回复
热议问题