复合表头demo

 <HTML>
 <HEAD>
 <style>
.grid{
    border:solid 1px #EEEEEE;
    border-collapse:collapse;
    height1:100%;
    width:100%;
    border-bottom: 1px solid #96d9f9;
    font-size: 14px;
}
.grid-head{
    text-align: center;
    height: 28px;
    font-weight: bold;
    border: solid 1px inactiveborder;
}
.subtotal-column{
    border: solid 1px inactiveborder;
    text-align: right;
    font-weight: bold;
    background-color: #CCDDED;
}
.total-column{
    border: solid 1px inactiveborder;
    text-align: right;
    font-weight: bold;
    background-color: #BBDDED;
}
.subtotal-row{
    border: solid 1px inactiveborder;
    text-align: right;
    font-weight: bold;
    background-color: #CCEDDD;
}
.total-row{
    border: solid 1px inactiveborder;
    text-align: right;
    font-weight: bold;
    background-color: #AAEDDD;
}
 </style>

 

 

<BODY>
 <div id="aaaa"></div><BR>
 <div id="bbbb"></div>
  <SCRIPT LANGUAGE="JavaScript">
  var table = new TableHeader();

  var render = 'new Array("(2,2,时间)(1,2,收入)(1,2,支出)","(1,1,充值)(1,1,手续费)(1,1,提现)(1,1,手续费)",'
        +'"(2,1,2008),(1,1,上半年)(1,1,10)(1,1,11)(1,1,12)(1,1,13)","(1,1,下半年)(1,1,2000)(1,1,21)(1,1,22)(1,1,23)",'
        +'"(2,1,2009),(1,1,上半年)(1,1,20)(1,1,21)(1,1,22)(1,1,23)","(1,1,下半年)(1,1,30)(1,1,31)(1,1,32)(1,1,33)")';
  table.buildRender(render);
  table.toUI();
  //document.getElementById("aaaa").innerHTML = table.tableObj.outerHTML;

  table.subTotalRow("全年",1,1, 2,3, "subtotal-row");
  table.subTotalRow("全年",1,1, 5,6, "subtotal-row");
  table.addStatRow("合计","$4+$7", 8,0,2, "total-row");
  table.subTotalColumn("小计",1,1, 2,3, "subtotal-column");
  table.subTotalColumn("小计",1,1, 5,6, "subtotal-column");
  table.addStatColumn("总计","$4+$7", 0,8,2, "total-column");
  //table.deleteRow(7);
  //table.deleteRow(4);
  //table.deleteColumn(8);
  //table.tableObj.rows[7].deleteCell(7);
  table.formatNumbit(2,8, 2,8, 1, true);
  document.getElementById("bbbb").innerHTML = table.tableObj.outerHTML;
  </SCRIPT>
 </BODY>
</HTML>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值