Tables and cells sizes

33 views
Skip to first unread message

abdelkader didouh

unread,
Oct 17, 2014, 6:39:24 AM10/17/14
to google-visua...@googlegroups.com
Hello everyone 
I am sorry if am posting in the wrong place. but i am having trouble changing the height of a table. how can i have larger cells. or where can i specify these tributes? 
here is the code am using 

var data2 = google.visualization.arrayToDataTable([
['sites', 'Monthy', 'Quarterly','Yearly'],
['Site1',  1000,      400,  1000],
['Site2',  1170,      460,  1000],
['Site3',  660,       1120,  1000],
['Site4',  1030,      540,  1000],
['Site5',  1000,      400,  1000],
['Site6',  1170,      460,  1000],
['Site7',  660,       1120,  1000],
['Site8',  1030,      540,  1000],
['Site9',  1000,      400,  1000],
['Site10',  1170,      460,  1000],
['Site11',  660,       1120,  1000],
]);
var table2 = new google.visualization.Table(document.getElementById('table_div2'));

table2.draw(data2, {showRowNumber: true});

html:

<div id="table_div2" style="width: 100%;padding:2%"></div>

Find attached the output table. which as you can see is small and i would like to stretch it to fit the container (grey)

Thank you in advance
 

Capture.PNG

Andrew Gallant

unread,
Oct 17, 2014, 8:53:19 AM10/17/14
to google-visua...@googlegroups.com
Making the rows fill the container exactly will be quite difficult to do, but you can adjust the height of the rows in CSS or by adding classes/CSS to individual cells.  If the outer container (the grey area, assuming there are no layers of HTML between the grey area and the table's container div) has a defined height, then you can set the height of the table's container to be 100% so the table itself will fill the available space, even if the rows do not.

abdelkader didouh

unread,
Oct 17, 2014, 10:03:18 AM10/17/14
to google-visua...@googlegroups.com
Thank you for your quick response but i already tried to put the hieght in 100% but as you said it just put the slider at the end as you can see in the attachement i will try the to creat a class for rows.

Kind regards 

--
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/7y0gia0FAvE/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.

Capture.PNG
Reply all
Reply to author
Forward
0 new messages