HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
50
1
anychart.onDocumentReady(function () {
2
3
// set stage
4
var stage = anychart.graphics.create("container");
5
6
// create table
7
var table = anychart.standalones.table();
8
9
// set table content
10
table.contents([
11
[
12
null,
13
"2003 Sales",
14
"2004 Sales"
15
],[
16
"January",
17
"$10000",
18
"$12000"
19
],[
20
"February",
21
"$12000",
22
"$15000"
23
],[
24
"March",
25
"$18000",
26
"$16000"
27
],[
28
"April",
29
"$11000",
30
"$15000"
31
],
32
[
33
"May",
34
"$9000",
35
"$14000"
36
]
37
]);
38
39
// settings for the first row
40
table.getCol(0)
41
.width(70) // set row height
42
.cellFill("#F5F5F5") // set row color
43
.fontWeight(900); // set font weight for text in the row
44
45
table.getRow(0).height(40);
46
table.cellBorder("#B8B8B8").hAlign("center").vAlign("middle");
47
48
// set table container and initiate draw
49
table.container(stage).draw();
50
});