Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- Google API, Table Visualization, No styles
- 1. Go to https://code.google.com/apis/ajax/playground/?type=visualization
- 2. Click on "Edit HTML" in the top right corner of the "Edit Code" box
- 3. Paste this
- 4. Run Code via the button on the top right corner of the "Output" box (bottom box)
- You are free to copy and use this sample in accordance with the terms of the
- Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
- -->
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
- <title>
- Google Visualization API Sample
- </title>
- <script type="text/javascript" src="http://www.google.com/jsapi"></script>
- <script charset="utf-8" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
- <script type="text/javascript">
- google.load('visualization', '1', {packages: ['table']});
- </script>
- <script type="text/javascript">
- function tableClassHack() {
- var className = 'google-visualization-table-table';
- $('.'+className).removeClass(className);
- }
- function drawVisualization() {
- // Create and populate the data table.
- var data = google.visualization.arrayToDataTable([
- ['Name', 'Height', 'Smokes'],
- ['Tong Ning mu', 174, true],
- ['Huang Ang fa', 523, false],
- ['Teng nu', 86, true],
- ['Tong Ning mu', 174, true],
- ['Huang Ang fa', 523, false],
- ['Teng nu', 86, true],
- ['Tong Ning mu', 174, true],
- ['Huang Ang fa', 523, false],
- ['Teng nu', 86, true]
- ]);
- // Create and draw the visualization.
- visualization = new google.visualization.Table(document.getElementById('table'));
- visualization.draw(data, {
- page: 'enable',
- pageSize: 2
- });
- // Create and draw the visualization.
- visualization = new google.visualization.Table(document.getElementById('tablenostyle'));
- visualization.draw(data, {
- page: 'enable',
- pageSize: 2,
- cssClassNames: {
- headerRow: 'someclass',
- tableRow: 'someclass',
- oddTableRow: 'someclass',
- selectedTableRow: 'someclass',
- hoverTableRow: 'someclass',
- headerCell: 'someclass',
- tableCell: 'someclass',
- rowNumberCell: 'someclass'
- }
- });
- google.visualization.events.addListener(visualization , 'page',
- function(event) {
- tableClassHack();
- });
- tableClassHack();
- }
- google.setOnLoadCallback(drawVisualization);
- </script>
- </head>
- <body style="font-family: Arial;border: 0 none;">
- <div id="table"></div>
- <hr style="margin: 2em 0;"/>
- <div id="tablenostyle"></div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment