简体   繁体   中英

How can I change the css properties of a google visualization table and it columns?

How can I change the css properties of a google visualization table and it's columns? I've read on the dev website how to adjust individual cell and row background, text color, etc., but there is no information on how to adjust column or table boarder, color, padding, etc.

This code is from the google dev website and the example is also found in this post.

CSS Properties:

<style>
.orange-background {
   background-color: orange;
  }

 .orchid-background {
  background-color: orchid;
 }

.beige-background {
 background-color: beige;
  }
</style>

Table Code:

var cssClassNames = {
'headerRow': 'italic-darkblue-font large-font bold-font',
'tableRow': '',
'oddTableRow': 'beige-background',
'selectedTableRow': 'orange-background large-font',
'hoverTableRow': '',
'headerCell': 'gold-border',
'tableCell': '',
'rowNumberCell': 'underline-blue-font'};

var options = {'showRowNumber': true, 'allowHtml': true, 'cssClassNames': cssClassNames};

var data = new google.visualization.DataTable();

//... add data here ...

var table = new google.visualization.Table(container);
table.draw(data, options);

There are no classname properties that refer to the columns or table as a whole. My priority is to eliminate the table boarder on the outside and adjust the column width, making the entire table smaller.

Thanks in advance!

i did a google search on ' google-visualization-table-table ' and came across this page .

It had multiple examples of table css properties, ie.:

.google-visualization-table-table {
  font-family: arial, helvetica;
  font-size: 10pt;
  cursor: default;
  margin: 0;
  background: white;
  border-spacing: 0;
}

thanks for the help asgallant !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM