NEW 140719
display: table-cell with width: 100% within a <td colspan=“2”> does not fill parent cell
https://bugs.webkit.org/show_bug.cgi?id=140719
Summary display: table-cell with width: 100% within a <td colspan=“2”> does not fill ...
Dai Rees
Reported 2015-01-21 00:06:35 PST
Given this CSS and HTML: table { width: 100%; } table label { display: table-cell; white-space: nowrap; } table span { display: table-cell; width: 100%; } table input { width: 100%; box-sizing: border-box; } <table> <tbody> <tr> <td> <label>Name</label> <span> <input type="text" /> </span> </td> <td> <label>Another field</label> <span> <input type="text" /> </span> </td> </tr> <tr> <td> <label>Really long field name</label> <span> <input type="text" /> </span> </td> <td> <label>S</label> <span> <input type="text" /> </span> </td> </tr> </tbody> </table> In Internet Explorer and Firefox, the textbox next to "really long field name" fills the containing cell's width, however in Chrome and iOS Safari (iOS 8) it does not and it has the default <input> width.
Attachments
Safari 15.6 and STP 151 differ from other browsers (785.39 KB, image/png)
2022-08-16 08:42 PDT, Ahmad Saleem
no flags
Dai Rees
Comment 1 2015-01-21 00:07:43 PST
There is a mistake in the example above, there should only be 1 column in the second row, not two. Here is the correct HTML: <table> <tbody> <tr> <td> <label>Name</label> <span> <input type="text" /> </span> </td> <td> <label>Another field</label> <span> <input type="text" /> </span> </td> </tr> <tr> <td colspan="2"> <label>Really long field name</label> <span> <input type="text" /> </span> </td> </tr> </tbody> </table>
Ahmad Saleem
Comment 2 2022-08-16 08:42:34 PDT
Created attachment 461674 [details] Safari 15.6 and STP 151 differ from other browsers I took HTML from Comment 01 and CSS from Comment 0 and turned them into JSFiddle: Link - https://jsfiddle.net/ryzvLsgo/show As can be seen from attached screenshot, Safari 15.6 / STP 151 render the "really long field" not so long compared to other browsers (Chrome Canary 106 and Firefox Nightly 105). I am not sure on web-spec but I think it is reproducible since Safari is not match with other browser and it is interop issue. Appreciate if someone can give more insight. Thanks!
Note You need to log in before you can comment on or make changes to this bug.