Chrome-specific CSS issue setting table cell to display:block

前端 未结 3 602
甜味超标
甜味超标 2021-01-02 17:14

I found this question that seemingly had what I wanted. I am using chrome 32.0.1700.102 and even the fiddle on the first answer amazingly works fine for me.

However

3条回答
  •  渐次进展
    2021-01-02 17:27

    I always define the doctype, but this issue started occuring after the last Chrome update 45.0.2454.85 in my responsive design. The stacked table cells would render as a hybrid of table-cell and table-row after resizing the browser at responsive breakpoints (media queries), or when switching from portrait to landscape and back (if landscape didn't stack the table cells and portrait did). This bug occurs only when there are more than two table cells.

    The solution: In the containing table row tr set it to display:table-cell.

    table.classname tr { display:table-cell !important; }
    table.classname td { display:block; width:100% !important; }
    

提交回复
热议问题