CSS table right margin in scrollable div

后端 未结 4 1210
隐瞒了意图╮
隐瞒了意图╮ 2021-01-20 04:08

I have div with \"overflow: scroll\" and fixed-size table inside.
I need to add empty space below and on the right of the table.
I\'m using following code, however i

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-20 04:37

    You could reset the default display:table to inline-table.

    table {
      display: inline-table;
    }
    

    div {
        display: inline-block;
        width: 100px;
        height: 100px;
        background: blue;
        overflow: scroll;
    }
    table {
        display: inline-table;
        table-layout: fixed;
        background: red;
        margin-bottom: 20px;
        margin-right: 20px;
    }
    td {
        min-width: 150px;
        max-width: 150px;
    }
    a
    b
    c
    d

提交回复
热议问题