Table Chart Example

An example of a Google Table Chart with height constraints.

by gdicerbo

HTML

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<style> 
            .cssHeaderRow {
                background-color: #8dc641;
                border: none !important;
            }
            .cssTableRow {
                background-color: #Ffffff;
                
                }
            .cssOddTableRow {
                background-color: #ffffff;
            }
            .cssSelectedTableRow {
                font-size: 20px;
                font-weight: bold;
            }
            .cssHoverTableRow {
                background: #ccc;
            }
            .cssHeaderCell {
                border: none !important;
                                background-color: #8dc641;
                                color: #ffffff;
            }
            .cssTableCell {

               font-size: 12px;
                               border: none !important;
                                text-align: center;

            }
            .cssRowNumberCell {
                text-align: center;
            }
</style>

<script>      google.charts.load('current', {'packages':['table']});
      google.charts.setOnLoadCallback(drawTable);

      function drawTable() {
         var query = new google.visualization.Query(
  'https://docs.google.com/spreadsheets/d/1sVdC24p4B7jxx19lhP0B-k-LvRClBYs1ygIFF3qGd_I/gviz/tq?gid=2067204790');
  query.send(handleQueryResponse);
}


 function handleQueryResponse(response) {
var data = response.getDataTable();
        var table = new google.visualization.Table(document.getElementById('table_div'));
var cssClassNames = {
                    'headerRow': 'cssHeaderRow',
                    'tableRow': 'cssTableRow',
                    'oddTableRow': 'cssOddTableRow',
                    'selectedTableRow': 'cssSelectedTableRow',
                    'hoverTableRow': 'cssHoverTableRow',
                    'headerCell': 'cssHeaderCell',
                    'tableCell': 'cssTableCell',
     ...