Any way to synchronize table column widths with HTML + CSS?

前端 未结 9 1322
花落未央
花落未央 2020-12-24 05:05

I have a number of tables with the same columns and it would look a lot nicer if they shared the same column widths. Is such a thing possible? Putting them in the same tab

9条回答
  •  借酒劲吻你
    2020-12-24 05:56

    The easiest way is kind of a 'dirty' way, but it works the best. It does exactly what's required:

    Just merge your two tables into one table. In my case the only thing between the two tables was an h3

    So my table

    Title

    became this:

    Title

    this way your table will 'sync' it's size up. of course this only works when there isn't too much complex stuff in between the two tables, but I'm guessing in most cases it isn't. if it was, the sync wouldn't be needed in the first place.

    提交回复
    热议问题