summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/table/append-cells.html
blob: 661619fb28273cedce70129438499a96e698185e (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
<html>
<head>
<title>Don't let appendChild break the table column count (bug 3702)</title>
</head>
<body>
<p>Both rows should have the same width (725px).</p>
<table cellpadding="0" cellspacing="0" style="table-layout: fixed; width: 725px;">
    <tr id='first_row'>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>

<!-- reference rendering -->
<table cellpadding="0" cellspacing="0" style="table-layout: fixed; width: 725px;">
    <tr>
        <td style="background-color: LawnGreen;">1</td>
        <td style="background-color: Cyan;">2</td>
        <td style="background-color: Yellow;">3</td>
        <td style="background-color: Orange;">4</td>
    </tr>
</table>


<script>
    firstRow = document.getElementById("first_row")
	
	function addCell(color) {
        cell = document.createElement("td");
        cell.appendChild(document.createTextNode("cell"));
        cell.setAttribute("style", "background-color: " + color + ";");
        firstRow.appendChild(cell);
	}
	
	addCell("LawnGreen");
	addCell("Cyan");
	addCell("Yellow");
	addCell("Orange");
</script>
</body>
</html>