How can I make the first and second column of a table sticky

后端 未结 2 1440
太阳男子
太阳男子 2020-12-19 06:51

i have a div with with property

`
2条回答
  •  盖世英雄少女心
    2020-12-19 07:05

    @vonkly is almost right about position:absolute. But you don't have to set left:0. With left:auto, you can spare position:relative too.

    table {
        padding-left: (width-of-your-td-elements);
    }
    
    table td:first-of-type {
        position: absolute;
    }
    

提交回复
热议问题