Table width 100% is off by a single pixel (depending on actual width)

前端 未结 3 1501
轻奢々
轻奢々 2021-02-14 03:12

I have a table in a div inside another div. The direct container has a width of 40%, and I want the table to be as wide as th

3条回答
  •  萌比男神i
    2021-02-14 03:22

    I had the same problem and managed to solve it by setting the width slightly higher:

    width: 100.12%
    

    I made an attempt to make the extra percentage small enough to solve most cases, but not create an overflow of 1 px.

    It worked for me. This is somewhat of a dirty fix though.

提交回复
热议问题