以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 怎么设置table到手机屏幕四边的边距? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=114706) |
-- 作者:zhangjian222200 -- 发布时间:2018/2/14 8:04:00 -- 怎么设置table到手机屏幕四边的边距? 如题: 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 |
-- 作者:有点蓝 -- 发布时间:2018/2/14 8:54:00 -- CSS 内边距属性(Padding):http://www.w3school.com.cn/cssref/index.asp#padding外边距Margin
|
-- 作者:zhangjian222200 -- 发布时间: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编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/2/14 10:11:00 -- 你设置的是table的边距和图片有啥关系,何况图片设置的是自动大小,如果图片大小不一致,边距肯定也就不一样 如果想图片居中,可以这样 .Attribute = "style=\'margin:0.25em;text-align: center;\'"
|