【发布时间】:2016-03-31 11:14:21
【问题描述】:
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('visualization', '1', { packages: ['table'] });
</script>
<script type="text/javascript">
var visualization;
function drawVisualization() {
var query = new google.visualization.Query(
'https://docs.google.com/spreadsheets/d/18KqoG0VT8c5eaT6IdSzczRPXJX4-CPFfBeImv07n5NA/edit#gid=1324681333');
query.setQuery('SELECT B, C, D, E, F, H, I, G ');
query.send(handleQueryResponse);
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
return;
}
var data = response.getDataTable();
visualization = new google.visualization.Table(document.getElementById('table'));
visualization.draw(data, { legend: 'bottom' });
}
google.setOnLoadCallback(drawVisualization);
</script>
<br />
<div id="table">
</div>
我的英语不好,我不是程序员。我只想以不同的方式调整 B、C、D、E、F、H、I、G 列的大小。谢谢你。我希望它不违反网站规则。
【问题讨论】:
-
是的,我想为每一列设置一个特定的宽度(至少两个或三个)
-
我应该在哪里插入该代码?
标签: javascript jquery html google-sheets google-visualization