-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css2][css-tables] Do collapsed tracks also shrink the table wrapper box or only the table grid box? #11408
Labels
Comments
Loirooriol
changed the title
[css2][css-tables] Should tables re-resolve their margins after shrinking due to
[css2][css-tables] Do collapsed tracks also shrink the table wrapper box or only the table grid box?
Dec 23, 2024
visibility: collapse
?
Though Gecko is inconsistent with the block axis, where the wrapper doesn't stay with the same size as before collapsing a row: <!DOCTYPE html>
<div style="border: 6px solid; width: 150px">
<table style="width: 100px; height: 100px; border-spacing: 0; background: cyan; outline: solid magenta">
<col style="visibility: collapse"></col>
<tr style="visibility: collapse"><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</div>
|
Note that Blink doesn't shrink the wrapper beyond the size of the caption. Since it doesn't allow the wrapper to be bigger than the grid, it seems to add trailing tracks. <!DOCTYPE html>
<table style="width: 100px; height: 50px; border-spacing: 0; background: cyan; outline: solid magenta; border: solid">
<caption style="width: 75px; height: 25px; background: orange"></caption>
<col style="visibility: collapse"></col>
<td></td><td style="background: yellow"></td>
</table>
|
OK, so things get even weirder:
Code<!DOCTYPE html>
<style>
.container { display: inline-flex; padding: 5px; border: 5px solid; vertical-align: top }
table { outline: 5px solid magenta; border: 5px solid cyan; width: 100px; height: 100px }
col + col, tr + tr { visibility: collapse }
td { background: yellow }
</style>
<div class="container" style="display: inline-flex; flex-direction: row">
<table>
<col></col><col></col>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</div>
<div class="container" style="display: inline-flex; flex-direction: column">
<table>
<col></col><col></col>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</div>
<div class="container" style="display: inline-grid">
<table>
<col></col><col></col>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</div>
<div class="container" style="display: inline-block">
<table>
<col></col><col></col>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</div>
<div class="container" style="position: relative">
<table style="position: absolute">
<col></col><col></col>
<tr><td></td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://drafts.csswg.org/css2/#blockwidth
https://drafts.csswg.org/css2/#dynamic-effects
auto
margins usingwidth: 100px
, so they become 25px each. Then the table ends up being only 50px, but the margins stay as 25px.auto
margins with the final width, so they become 50px each.visibility: collapse
.Blink seems better I guess.
The text was updated successfully, but these errors were encountered: