交替行背景颜色

除了上一节介绍的高亮显示行列功能,我们还可以设置交替行背景颜色,只是此功能默认是关闭的。

表有一个整数型的Alternate属性,用于设置每多少行显示一个不同背景颜色的行。

一个例子

Select Case e.Path
    Case "table.htm"
       
Dim wb As New WeUI
        With wb.AddTable("","Table1")
            .Highlight = -1
'
关闭高亮显示
            .Alternate = 2
'
每两行显示一个不同背景颜色的行
            .RowHead = 1
            .head.AddRow("",
"
部门","姓名","年龄","电话","地址")
            .body.AddRow("1",
"
技术部","张三","36","110","中国北京")
            .body.AddRow("2",
"
技术部","李四","38","110","中国上海")
            .body.AddRow("3",
"
技术部","王五","39","110","中国深圳")
            .body.AddRow("4",
"
生产部","赵六","39","110","中国深圳")
            .body.AddRow("5",
"
生产部","刘七","39","110","中国深圳")
        End With
        e.WriteString(wb.Build)

End
Select

这是在手机上显示的效果:

 


本页地址:http://www.foxtable.com/mobilehelp/topics/0070.htm