That is how I decided to solve this problem. I will not accept my own answer if someone has something more elegant.
I initially had:
var visualization = new google.visualization.Table(document.getElementById('table'));
visualization.draw(data, {
sort: "disable",
allowHtml: true,
showRowNumber: true,
page: "enable",
pageSize: 9
});
I added another one that went to a div, which I will hide with css.
var visualization = new google.visualization.Table(document.getElementById('printerFriendly'));
visualization.draw(data, {
sort: "disable",
allowHtml: true,
showRowNumber: true,
page: "disable"
});
Then I added the following rules to one of my css files.
@media print
{
#table{ display:none; }
}
@media screen
{
#printerFriendly{ display:none;}
}
This hides one table during normal use and hides another during printing. I was hoping for something a little cleaner than this, but this solution was very easy to implement.
source
share