How to get the in HTML tables to fit content, and let a specific fill in the rest

后端 未结 4 1145
一向
一向 2020-12-23 13:23

This is a hypothetical example:

4条回答
  •  时光说笑
    2020-12-23 13:59

    Setting CSS width to 1% or 100% of an element according to all specs I could find out is related to the parent. Although Blink Rendering Engine (Chrome) and Gecko (Firefox) at the moment of writing seems to handle that 1% or 100% (make a columns shrink or a column to fill available space) well, it is not guaranteed according to all CSS specifications I could find to render it properly.

    One option is to replace table with CSS4 flex divs:

    https://css-tricks.com/snippets/css/a-guide-to-flexbox/

    That works in new browsers i.e. IE11+ see table at the bottom of the article.

提交回复
热议问题