I have two questions. I am trying to create a google charts table.
A) I need the ID of the actual table element being created so I can make some modifications. So, how can I set/get the table ID?
B) How can I add custom CSS class to the table tag? I basically want to add css from material-design-lite to these tables.
Thank You so much!
First, you can assign
cssClassNames
to specific areas of the chart, using the Configuration Options.Such as...
If that doesn't help, you can modify the dom as needed, once the chart is
ready
.You have to specify a container
id
to draw the chart originally, usually adiv
.So you don't need the
id
of the googletable
to modify it. Just browse the contents of the container you defined using JavaScript to find what you need.For instance, there is a known problem with locking the first column heading row when scrolling in certain browsers. Following is the function I use to fix that, I'm cheating a little, using
MicrosoftAjax.js
togetBounds
.The point is, within the
div
you define for the chart, you can manipulte the google chart, if you just know how to explore the dom. Once you find the element you need, you can apply what ever style you want...In my example, whenever the table has too many rows and the column header needs to be locked, there are three
div
's instead of two. As such, I find the first table row and lock it.Hope this helps...