Why does flex-box work with a div, but not a table?

后端 未结 3 565
后悔当初
后悔当初 2020-12-03 14:37

The following simple snippet results in a single web page that takes up the available screen space with a header at the top, a footer at the bottom, and the main content tak

3条回答
  •  不知归路
    2020-12-03 15:06

    Well one thing, you should use vw and vh units for height and width, they are not supported throughout most browsers, but they are really good at what they can do. Also, with the table issue, you never designated it a width, so you'll only get a cell that fits the text.

    Adding something like "width: 75vw;" to the table style would help (you can use %s for width)

提交回复
热议问题