Foxtable(狐表)用户栏目专家坐堂 → 怎么设置table到手机屏幕四边的边距?


  共有2216人关注过本帖树形打印复制链接

主题:怎么设置table到手机屏幕四边的边距?

帅哥哟,离线,有人找我吗?
zhangjian222200
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1519 积分:10712 威望:0 精华:0 注册:2016/9/12 11:18:00
怎么设置table到手机屏幕四边的边距?  发帖心情 Post By:2018/2/14 8:04:00 [只看该作者]

如题:

Select Case e.Path

    Case "test.htm",""
        Dim wb As New WeUI
        With wb.AddTable("","Table1")
           '.head.AddRow("部门","姓名","年龄","电话","地址") '表头
            .body.AddRow("<img src='./images/001.jpg' border='0' style='width:auto;height:auto;max-width:100%;max-height:100%' />","<img src='./images/001.jpg' border='0' style='width:auto;height:auto;max-width:100%;max-height:100%' />")
        End With
        e.WriteString(wb.Build)
End Select

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105481 积分:536396 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/2/14 8:54:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
zhangjian222200
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1519 积分:10712 威望:0 精华:0 注册:2016/9/12 11:18:00
  发帖心情 Post By:2018/2/14 9:44:00 [只看该作者]

Select Case e.Path
    Case "test.htm",""
        Dim wb As New WeUI
        With wb.AddTable("","Table1")
           '.head.AddRow("部门","姓名","年龄","电话","地址") '表头
            .body.AddRow("<img src='./images/001.jpg' border='0' style='width:auto;height:auto;max-width:100%;max-height:100%' />","<img src='./images/002.jpg' border='0' style='width:auto;height:auto;max-width:100%;max-height:100%' />")
         .Attribute = "style='margin:0.25em 0.25em 0.25em 0.25em;'" ’加上这一行,发现Table1到右侧屏幕距离为0,其他3边正常
        End With
        e.WriteString(wb.Build)
End Select
[此贴子已经被作者于2018/2/14 10:11:52编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105481 积分:536396 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/2/14 10:11:00 [只看该作者]

你设置的是table的边距和图片有啥关系,何况图片设置的是自动大小,如果图片大小不一致,边距肯定也就不一样

如果想图片居中,可以这样
.Attribute = "style='margin:0.25em;text-align: center;'" 

 回到顶部