Override and reset CSS style: auto or none don't work

后端 未结 7 1187
灰色年华
灰色年华 2021-01-30 04:50

I would like to override following CSS styling defined for all tables:

table {
        font-size: 12px;
        width: 100%;
        min-width: 400px;
               


        
7条回答
  •  时光说笑
    2021-01-30 05:19

    I believe the reason why the first set of properties will not work is because there is no auto value for display, so that property should be ignored. In that case, inline-table will still take effect, and as width do not apply to inline elements, that set of properties will not do anything.

    The second set of properties will simply hide the table, as that's what display: none is for.

    Try resetting it to table instead:

    table.other {
        width: auto;
        min-width: 0;
        display: table;
    }
    

    Edit: min-width defaults to 0, not auto

提交回复
热议问题