Style last row of Google Chart Table

554 views
Skip to first unread message

TheInnovator

unread,
Mar 24, 2014, 11:17:01 PM3/24/14
to google-visua...@googlegroups.com
Hello,

I am trying to style the last row in my table.

Here's my code:

var tblOption = {
showRowNumber: true,
height:250,
width:500,
alternatingRowStyle: true,
cssClassNames: {
            tableRow: 'conformanceAlternate',
selectedTableRow: 'conformanceFooter'     <--How do I select the last row?
}
};

Jeremy Faller

unread,
Mar 25, 2014, 9:14:05 AM3/25/14
to google-visua...@googlegroups.com
You want to use the dataTable you've populated the table with and use the following code:


table.setSelection([{row:data.getNumberOfRows()-1}]);

Jeremy Faller

unread,
Mar 25, 2014, 9:14:30 AM3/25/14
to google-visua...@googlegroups.com

asgallant

unread,
Mar 25, 2014, 11:03:00 AM3/25/14
to google-visua...@googlegroups.com
Do you want to style the last row, or select it?  To select, do as Jeremy Faller suggested; to style, do this:

#myTableDiv tr:last-child {
    font-weight: bold;
}

where myTableDiv is the id of your table's container div.


On Monday, March 24, 2014 11:17:01 PM UTC-4, TheInnovator wrote:

Isaac Sogunro

unread,
Mar 25, 2014, 3:16:52 PM3/25/14
to google-visua...@googlegroups.com
I want to highlight the last row.  That doesn't seem to work.

#conformTbl tr:last-child {
    font-weight: bold;
}



<table>
<td>
<table>
<tr><td><div id="chart_div" style="width: 700px; height: 110px;"></div></td></tr>
</table>
</td>
<td>
<table id="conformTbl">
<tr><td><div id="vizTbl" style="width: 700px; height: 350px;"></div></td></tr>
</table>
</td>
</table>


--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/3xHiGt7_1Pk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
-Isaac-

http://twitter.com/#!/feedy0urmind
You are today where your thoughts have brought you; you will be tomorrow where your thoughts take you.
- James Allen

asgallant

unread,
Mar 25, 2014, 3:32:08 PM3/25/14
to google-visua...@googlegroups.com
#conformTbl is not the container div in your case; #vizTbl is:

#vizTbl tr:last-child {
    font-weight: bold;
}

To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages