2012-09-29 23:42:29 -07:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!--
|
|
|
|
Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
-->
|
|
|
|
<!--
|
|
|
|
Testcase with table parts inside of a flex container, triggering
|
2012-10-15 12:42:43 -07:00
|
|
|
table-fixup. We use justify-content:space-between to stick packing
|
2012-09-29 23:42:29 -07:00
|
|
|
space between flex items, so that we can verify that e.g. a contiguous
|
|
|
|
run of <td>s will end up in the same flex item (wrapped in a table).
|
|
|
|
-->
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<style>
|
|
|
|
div.flexbox {
|
|
|
|
border: 1px dashed blue;
|
|
|
|
width: 200px;
|
2012-10-15 12:42:43 -07:00
|
|
|
display: flex;
|
|
|
|
justify-content: space-around;
|
2012-09-29 23:42:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
<!-- NOTE: table-fixup pads each td element by 1px on each side. We
|
|
|
|
override that for top & bottom, for simplicity. So the td makes us
|
|
|
|
generate a box that's 2px wider than its contents. -->
|
|
|
|
td {
|
|
|
|
padding-top: 0px;
|
|
|
|
padding-bottom: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.a {
|
|
|
|
background: lightgreen;
|
|
|
|
width: 48px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.b {
|
|
|
|
background: yellow;
|
|
|
|
width: 48px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.c {
|
|
|
|
background: pink;
|
|
|
|
width: 48px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<!-- Just 2 adjacent table cells (they end up in the same table) -->
|
|
|
|
<div class="flexbox"
|
|
|
|
><td class="a">cell1</td><td class="b">cell2</td></div>
|
|
|
|
|
|
|
|
<!-- Table cell followed by tbody (they end up in the same table) -->
|
|
|
|
<div class="flexbox"
|
|
|
|
><td class="a">cell1</td><tbody class="b">t</tbody></div>
|
|
|
|
|
|
|
|
<!-- Empty table cell (ends up occupying 2px of width), followed by div,
|
|
|
|
followed by nonempty table cell. (3 flex items). -->
|
|
|
|
<!-- Note: We use "space-between" (instead of "space-around") here because
|
|
|
|
it makes the math cleaner. (100px split 2 ways instead of 3 ways.) -->
|
2012-10-15 12:42:43 -07:00
|
|
|
<div class="flexbox" style="justify-content: space-between"
|
2012-09-29 23:42:29 -07:00
|
|
|
><td></td><div class="c">div</div><td class="b">cell1</td></div>
|
|
|
|
</body>
|
|
|
|
</html>
|