21 lines
861 B
HTML
21 lines
861 B
HTML
<html>
|
|
<div style="width: 2000px; position: absolute; left: -9000px;">
|
|
<table style="background-color:blue"><tr><td>
|
|
|
|
<table id="table" style="width:100%; background-color:green; table-layout:fixed;"><tr><td>
|
|
Content
|
|
</td></tr></table>
|
|
|
|
</td></tr></table>
|
|
|
|
</div>
|
|
<span id="result">This test failed. The width of the fixed table should be 1994px, which is based on the width of its containing div.</span>
|
|
|
|
<script>
|
|
var table = document.getElementById("table");
|
|
var result = document.getElementById("result");
|
|
if (window.getComputedStyle(table, null).getPropertyValue("width") == "1994px")
|
|
result.innerHTML = "Success! The width of the fixed table is 1994px, which is based on the width of its containing div.";
|
|
</script>
|
|
</html>
|