What does max-width: 0px do?

后端 未结 1 1260
一整个雨季
一整个雨季 2021-01-26 13:19

An answer posted to jQuery.expandingTextarea not working inside a table involves the use on a table-cell of $(\'td\').css(\'max-width\',\'0px\').

The soluti

相关标签:
1条回答
  • 2021-01-26 13:33
    table {
      table-layout: fixed;
    }
    

    This fixes the cell widths to the value they are given. So if you do width: 30% on the cells, they won't resize based on their content and will maintain their set widths.

    If only some of the cells are given a width value, the remaining cells will share the space available. Use this functionality as a replacement to max-width.

    Using max-width: 0px is more of a quirk than reliable behaviour.

    DEMO

    0 讨论(0)
提交回复
热议问题