I am using the table in google charts. All of the data in the table is aligned right. I need to align the text in the center. I am building the table dynamically so I cannot apply the set cell method:
data.setCell(1, 1, 25000, '$25,000', {'className': 'bold-font center-text'});
I would like to apply the class name without applying the 25000 and $25000 values. Something like:
data.setCell(1, 1, '', '', {'className': 'bold-font center-text'});
I also don't want to apply this just to the first cell but entire table.
In conclusion, how do I center all of the text in a table?
add custom css
add this code to your page
"!important" is necessary to override google's left/right align for number/text.