设置列宽

默认情况下,系统会自动分配列宽。

通过ColWidth属性,可以指定列宽,这是一个字符型的属性,可以一次设置多列的宽度。

一个例子

下面的HttpRequest事件代码,将第一列(行号)的宽度设置为12px,第三列(姓名)的宽度设置为120px:

Select Case e.Path
    Case "table.htm"
       
Dim wb As New WeUI
        With wb.AddTable("","Table1")
            .RowHead = 1
            .ColWidth = "12px,,120px"
'设置列宽
            .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/0071.htm