5 background-color: cyan;
9 background-color: yellow;
13 background-color: lime;
17 background-color: pink;
27 function dumpWidths(table
)
29 var cell1
= document
.getElementById(table
+ "-one");
30 var cell2
= document
.getElementById(table
+ "-two");
31 document
.write("<p>");
32 document
.write("The table width is: " + document
.getElementById(table
).offsetWidth
+ "<br>");
33 document
.write("Column One is: " + Math
.round(100*cell1
.offsetWidth
/(cell1
.offsetWidth
+cell2
.offsetWidth
)) + "%");
34 document
.write("<br>");
35 document
.write("Column Two is: " + Math
.round(100*cell2
.offsetWidth
/(cell1
.offsetWidth
+cell2
.offsetWidth
)) + "%");
36 document
.write("</p><hr>");
41 <h1>Fixed Columns, Auto Span, Minwidth Table
</h1>
43 <table width=
"1" id=
"one" cellpadding=
0 cellspacing=
0>
45 <td width=
100 id=
"one-one" class=
"one">
46 <td width=
200 id=
"one-two" class=
"two">
49 <td colspan=
2 class=
"span">
50 <div style=
"width:100px"></div>
59 <table width=
"1" id=
"two" cellpadding=
0 cellspacing=
0>
61 <td width=
100 id=
"two-one" class=
"one">
62 <td width=
200 id=
"two-two" class=
"two">
65 <td colspan=
2 class=
"span">
66 <div style=
"width:600px"></div>
75 <table width=
"1" id=
"three" cellpadding=
0 cellspacing=
0>
77 <td width=
100 id=
"three-one" class=
"one">Fixed cell in column one with some text.
78 <td width=
200 id=
"three-two" class=
"two">Fixed cell in column two with a lot more text. Will the ratios be preserved?
81 <td colspan=
2 class=
"span">
82 <div style=
"width:600px"></div>
91 <table width=
"1" id=
"four" cellpadding=
0 cellspacing=
0>
93 <td width=
50 id=
"four-one" class=
"one"><div style=
"width:100px"></div>
94 <td width=
100 id=
"four-two" class=
"two"><div style=
"width:250px"></div>
97 <td colspan=
2 class=
"span">
98 <div style=
"width:600px"></div>