-
Notifications
You must be signed in to change notification settings - Fork 0
/
simpletable.html
34 lines (29 loc) · 1.06 KB
/
simpletable.html
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
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['table']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawTable);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawTable() {
var tableData = google.visualization.arrayToDataTable([
['Name', 'Height', 'Smokes'],
['Tong Ning mu', 174, true],
['Huang Ang fa', 523, false],
['Teng nu', 86, true]
]);
var dataTable = new google.visualization.Table(document.getElementById('table_div'));
dataTable.draw(tableData, null);
}
</script>
</head>
<body>
<div id="chart_div"></div>
<div id="table_div"></div>
</body>
</html>