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

后端 未结 7 1189
灰色年华
灰色年华 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:30

    The default display property for a table is display:table;. The only other useful value is inline-table. All other display values are invalid for table elements.

    There isn't an auto option to reset it to default, although if you're working in Javascript, you can set it to an empty string, which will do the trick.

    width:auto; is valid, but isn't the default. The default width for a table is 100%, whereas width:auto; will make the element only take up as much width as it needs to.

    min-width:auto; isn't allowed. If you set min-width, it must have a value, but setting it to zero is probably as good as resetting it to default.

提交回复
热议问题