summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/table/040.html
blob: f8fdf6a9d8a8ce88385745910a6a2860ea7ae40d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

<head>
<style>
.one {
  background-color: cyan;
}

.two {
  background-color: yellow;
}

.three {
  background-color: lime;
}

.span {
  background-color: pink;
}

td {
  height: 20px;
}

</style>

<script>
function dumpWidths(table)
{ 
  var cell1 = document.getElementById(table + "-one");
  var cell2 = document.getElementById(table + "-two");
  document.write("<p>");
  document.write("The table width is: " + document.getElementById(table).offsetWidth + "<br>");
  document.write("Column One is: " + Math.round(100*cell1.offsetWidth/(cell1.offsetWidth+cell2.offsetWidth)) + "%");
  document.write("<br>");
  document.write("Column Two is: " + Math.round(100*cell2.offsetWidth/(cell1.offsetWidth+cell2.offsetWidth)) + "%");
  document.write("</p><hr>");
}
</script>
</head>

<h1>Fixed Columns, Auto Span, Minwidth Table</h1>

<table width="1" id="one" cellpadding=0 cellspacing=0>
<tr>
<td width=100 id="one-one" class="one">
<td width=200 id="one-two" class="two">
</tr>
<tr>
<td colspan=2 class="span">
<div style="width:100px"></div>
</td>
</tr>
</table>

<script>
dumpWidths("one");
</script>

<table width="1" id="two" cellpadding=0 cellspacing=0>
<tr>
<td width=100 id="two-one" class="one">
<td width=200 id="two-two" class="two">
</tr>
<tr>
<td colspan=2 class="span">
<div style="width:600px"></div>
</td>
</tr>
</table>

<script>
dumpWidths("two");
</script>

<table width="1" id="three" cellpadding=0 cellspacing=0>
<tr>
<td width=100 id="three-one" class="one">Fixed cell in column one with some text.
<td width=200 id="three-two" class="two">Fixed cell in column two with a lot more text. Will the ratios be preserved?
</tr>
<tr>
<td colspan=2 class="span">
<div style="width:600px"></div>
</td>
</tr>
</table>

<script>
dumpWidths("three");
</script>

<table width="1" id="four" cellpadding=0 cellspacing=0>
<tr>
<td width=50 id="four-one" class="one"><div style="width:100px"></div>
<td width=100 id="four-two" class="two"><div style="width:250px"></div>
</tr>
<tr>
<td colspan=2 class="span">
<div style="width:600px"></div>
</td>
</tr>
</table>

<script>
dumpWidths("four");
</script>