You set properties on DataTable cells. Table Visualizations accept CSS
style information as properties, so you need to set the "style" property of
each cell you want to style. Use something like this:
data.setProperties(<rowIndex>, <columnIndex>, {style: 'text-align: right;
color: red'});
where the rowIndex and columnIndex are the indices of the row and column
that identify the cell. The style string can be any valid CSS.
On Tuesday, September 4, 2012 9:51:01 AM UTC-4, ismail atkurt wrote:
>
> Hi Luis,
>
> I am dealing with the same problem but I couldn't apply your solution.
> can you explain it briefly..
>
> best regards
>
> 20 Ağustos 2010 Cuma 01:48:59 UTC+3 tarihinde Luis yazdı:
>>
>> Hi all,
>>
>> I'm trying to add text to a set of columns in a DataTable, but for
>> certain columns I want to align the text to the right. I've notice
>> that by default for columns of type STRING the content is left
>> aligned, and for type NUMBER the content is right aligned.
>>
>> DataTable data = DataTable.create();
>> data.addColumn(ColumnType.STRING, "This should be left aligned");
>> data.addColumn(ColumnType.STRING, "This should be right aligned");
>>
>> data.addRows(X);
>>
>> data.setValue(0, 0,"Value A - On the left");
>> data.setValue(0, 1,"Value B - On the right");
>>
>> Does anyone how to make this work the way I need?
>>
>> Many thanks in advanced,
>> Luis
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/15rRgkDI7L8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.