以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  为何通过 wb.AddTable创建表时,再通过.Body.AddRow创建的底部合计栏金额列开始背景色不一致?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=130009)

--  作者:cnhh
--  发布时间:2019/1/10 19:29:00
--  为何通过 wb.AddTable创建表时,再通过.Body.AddRow创建的底部合计栏金额列开始背景色不一致?
 如下代码:
        With wb.AddTable("","Table1")
            .Attribute= "border=\'2\'"
            .RowHead = 1
            .ColWidth = "12px,120px,100px,80px,120px" \'设置列宽
            .Highlight =1
            .Alternate = 2 \'每两行显示一个不同背景颜色的行
            .CreateFromDataTable(DataTables("费用查询表"),True) \',"姓名","填表日期","报销金额(元)")
            Dim sum As Double = DataTables("费用查询表").compute("sum(BxJe)")

            With .Body.AddRow()
                .Attribute = "style=\'background-color:#F0FFFF\'"
                .AddCell(" 合  计 ","colspan=\'4\'")
                .AddCells(sum,"")
            End With
        End With

运行结果在合计栏的金额列背景色为何与前面单元不一致,如下:
图片点击可在新窗口打开查看

--  作者:有点甜
--  发布时间:2019/1/10 20:51:00
--  

你需要这个?

 

Select Case e.Path
    Case "test.htm", ""
        Dim wb As new WeUI
        With wb.AddTable("","Table1")
            .Attribute= "border=\'2\'"
            .RowHead = 1
            .ColWidth = "12px,120px,100px,80px,120px" \'设置列宽
            .Highlight =1
            .Alternate = 2 \'每两行显示一个不同背景颜色的行
            .CreateFromDataTable(DataTables("表A"),True)
           
            With .Body.AddRow()
                .Attribute = "style=\'background-color:#E4ECF7\'"
                .AddCell(" 合  计 ","colspan=\'4\'")
                .AddCells(12345,"")
            End With
        End With
        e.WriteString(wb.Build)
End Select