// 下述代码将创建一个KDTable,并指定列名、表头单元格的显示值、和表体数据
KDTable table = new KDTable();
String [] columnKeys = new String[]{"a","b","c","d"};
String [] head = new String[]{"a1","b1","c1","d1"};
String [][] body = new String[][] {{"a11","b11","c11","d11"},{"a22", "b22", "c22", "d22"}};
KDTableHelper.initTable(table, columnKeys, head, body);

// 下述代码先创建一个Collection数组,再将Collection数组填充到table中
int length = 5;
List [] ls = new ArrayList[length];
for (int j = 0; j < length; j++){
  List l = new ArrayList();
  for (int i = 0; i < 20; i++)
  {
      l.add("cell " + i);
  }
  ls[j] = l;
}
KDTableHelper.addRows(table, ls);

。。。

相关文章:

  • 2021-12-04
  • 2021-06-17
  • 2021-07-21
  • 2022-12-23
  • 2021-12-22
  • 2021-06-04
  • 2021-12-03
  • 2021-12-28
猜你喜欢
  • 2021-11-20
  • 2021-12-19
  • 2022-12-23
  • 2021-07-02
  • 2021-11-04
  • 2021-09-09
相关资源
相似解决方案