以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 显示错位 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=128394) |
||||
-- 作者:lshshlxsh -- 发布时间:2018/12/5 12:31:00 -- 显示错位 请问一下怎么动态合并单元格 根据条数合并几行数据
此主题相关图片如下:1.png 需要的效果图二
[此贴子已经被作者于2018/12/5 12:34:00编辑过]
|
||||
-- 作者:有点甜 -- 发布时间:2018/12/5 12:46:00 -- Dim e As RequestEventArgs = Args(0) Select Case e.Path Case "list.htm" Dim wb As New WeUI wb.AppendHTML("<style>.mark{background-color:red; color:white;}</style>", True) \'添加样式 With wb.AddTable("","Table1") .head.Addrow("物料","已领数量","领料明细") For j As Integer = 0 To DataTables("表A").DataRows.count-1 Dim dr = DataTables("表A").DataRows(j) If dr("条数") =1 Then With .body.AddRow( dr("物料代码") & "<br>" & dr("物料名称") ) .Addcell(dr("领料总数") ) .Addcell( dr("领料明细") ) End With Else If dr("条数") >1 Then With .body.AddRow .AddCell(dr("物料代码") & "<br>" & dr("物料名称") ,"rowspan=" & dr("条数") ) .AddCell( dr("领料总数") ,"rowspan=" & dr("条数") ) .AddCell( dr("领料明细") ) End With For i As Integer=2 To dr("条数") j += 1 dr = DataTables("表A").DataRows(j) .body.AddRow( dr("领料明细") ) Next End If Next End With e.WriteString(wb.Build) End Select |