以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  设置合并单元格样式  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=126004)

--  作者:刘林
--  发布时间:2018/10/11 22:23:00
--  设置合并单元格样式
 
        With wb.AddTable("","Table1")
            .head.AddRow(cps).Attribute="style=\'font-size:20px;color:blue;white-space:nowrap;\' align=\'center;\'"
            Dim i As Integer=0
            For Each cp As String In cps \'添加列标题
                Sheet(0, i).Value = cp
                i=i+1
            Next
            For r As Integer=0 To lst.Count-1
                With .body.AddRow()
                    .addcell(r+1)
                    Sheet(r +1, 0).Value = r+1
                    Dim j As Integer=1
                    For Each nm As String In nms
                        .AddCell(lst(r)(nm))
                        Sheet(r +1, j).Value = lst(r)(nm)
                        j=j+1
                    Next
                End With
            Next
           wb.AppendHTML("<style>.mark{background-color:red; color:white;}</style>", True) \'添加样式
            For Each bjList As String In bjlists
                With .body.AddRow()
                    .AddCell(bjlist & "平均分","colspan=\'4\',class=\'mark\'")
                    For Each js As String In jss
                        Dim xs As String = format(DataTables("成绩").sqlCompute("Avg(" & js & ")","[单位名称] = \'" & e.Cookies("userdw") & "\'And [考试名称] = \'" & e.PostValues("ksmc") & "\' and [班级全称] = \'" & bjlist & "\' and 学段= \'" & e.PostValues("xd") & "\'"),"#.00")
                        .addcell(xs)
                    Next
                    .AddCell(" ","colspan=\'3\'")
                End With
            Next
            .ActiveSheet = "menu"
        End With

请问老师,我在红部分,要合并列,同时设置单元格样式怎么做?这样设置没有效呢


--  作者:有点甜
--  发布时间:2018/10/11 22:41:00
--  

比如

 

.AddCell(bjlist & "平均分","colspan=\'4\' class=\'mark\' style=\'color:red;\'")