3 <body style=
"font-family: Ahem; -webkit-font-smoothing: none;">
5 div.table { display: table; }
6 div.section { display: table-row-group; }
7 div.caption { display: table-caption; }
8 div.colgroup { display: table-column-group; }
9 div.col { display: table-column; }
10 div.cell { display: table-cell; width:
50px; height:
50px; background-color: blue; }
11 div.row { display: table-row; }
12 div.block { width:
50px; height:
50px; background-color: blue; }
15 <div class=
"table" id=
"table-1">
16 <div class=
"cell"></div>
17 <div class=
"section" id=
"tbody-1">
21 <div class=
"table" id=
"table-2">
22 <div class=
"cell"></div>
23 <div class=
"row" id=
"row"></div>
26 <div class=
"table" id=
"table-3">
27 <div class=
"cell"></div>
28 <div class=
"caption" id=
"caption">
32 <div class=
"table" id=
"table-4">
33 <div class=
"cell"></div>
34 <div class=
"colgroup" id=
"colgroup">
38 <div class=
"table" id=
"table-5">
39 <div class=
"cell"></div>
40 <div class=
"section" id=
"tbody-5">
44 <div class=
"table" id=
"table-6">
45 <div class=
"cell"></div>
46 <div class=
"col" id=
"col-6">
50 <div class=
"table" id=
"table-7">
51 <div class=
"cell"></div>
56 <div class=
"table" id=
"table-8">
57 <div class=
"block"></div>
58 <div class=
"cell" id=
"cell"></div>
64 var cell
= document
.createElement("div");
65 cell
.className
= "cell";
69 function insertCell(tableID
, beforeID
)
71 var table
= document
.getElementById(tableID
);
72 var before
= document
.getElementById(beforeID
);
73 table
.insertBefore(createCell(), before
);
78 var row
= document
.createElement("div");
79 row
.className
= "row";
83 function insertRow(tableID
, beforeID
)
85 var table
= document
.getElementById(tableID
);
86 var before
= document
.getElementById(beforeID
);
87 table
.insertBefore(createRow(), before
);
90 function createBlock()
92 var block
= document
.createElement("div");
93 block
.className
= "block";
97 function insertBlock(tableID
, beforeID
)
99 var table
= document
.getElementById(tableID
);
100 var before
= document
.getElementById(beforeID
);
101 table
.insertBefore(createBlock(), before
);
104 document
.body
.offsetTop
;
106 insertCell("table-1", "tbody-1");
107 insertCell("table-2", "row");
108 insertCell("table-3", "caption");
109 insertCell("table-4", "colgroup");
110 insertRow("table-5", "tbody-5");
111 insertCell("table-6", "col-6");
112 insertCell("table-7", "block");
113 insertBlock("table-8", "cell");