Table overflowing outside of div

后端 未结 9 2103
鱼传尺愫
鱼传尺愫 2020-11-30 00:17

I\'m trying to stop a table that has width explicitly declared from overflowing outside of its parent div. I presume I can do this in some way using max-w

9条回答
  •  余生分开走
    2020-11-30 00:36

    You may try this CSS. I have experienced it working always.

    div {
      border-style: solid;
      padding: 5px;
    }
    
    table {
      width: 100%;
      word-break: break-all;
      border-style: solid;
    }
    Col 1 Col 2 Col 3 Col 4 Col 5
    data 1 data 2 data 3 data 4 data 5

    提交回复
    热议问题