【问题标题】:CSS on Google tables columnGoogle 表格列上的 CSS
【发布时间】:2010-09-17 03:42:28
【问题描述】:

我正在使用带有数据视图的 google-tables,但我不知道如何在我的列中获取任何类型的格式。

  var datatable = createGoogleData(...);
  datatable.setColumnProperty(2, 'className', 'hest1'); // <--- doesnt work
  var view = new google.visualization.DataView(datatable);
  ...
  view.setColumns([0, 1, { calc: blabla, type: 'string', label: 'blabla', 
       id: 'hest2'}]); // <---- doesnt work
  var table = new google.visualization.Table(document.getElementById('comment')); 
  table.draw(view);

即使有这两个设置(hest1 和 hest2),css 类也没有改变。

【问题讨论】:

    标签: css google-data-api


    【解决方案1】:

    我找到了解决方法:

    var datatable = createGoogleData(...);
    var view = new google.visualization.DataView(datatable);
    view.setColumns([0, 1, { calc: f, type: 'string', label: 'blabla']);
    var table = new google.visualization.Table(document.getElementById('comment')); 
    table.draw(view, {allowHtml:true});
    
    function f(dataTable, rowNum) {
        return '<span class="google-cg-date-field">'+ dataTable.getValue(rowNum, 3) +'</span>';
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多