[英]table width doesn't work on multiple row
http://jsfiddle.net/qse5owx6/ http://jsfiddle.net/qse5owx6/
Just sick, tried to debug this for an hour. 刚生病,尝试调试了一个小时。 Why the table is stretch by the content?
为什么表格会被内容拉伸? I have wrap the layout properly with
tr
and td
. 我已经用
tr
和td
正确包装了布局。 I'm designing html for emails. 我正在设计用于电子邮件的html。
why the width:600px doesn't work on the table? 为什么width:600px在桌子上不起作用?
add table-layout: fixed;
添加
table-layout: fixed;
Please see http://jsfiddle.net/qse5owx6/5/ 请参阅http://jsfiddle.net/qse5owx6/5/
see here jsfiddle 看到这里jsfiddle
well this happens because you've set specific fixed widths ( in pixels ) to all the elements , that's why you can't force the table to a smaller width. 发生这种情况的原因是,您已经为所有元素设置了特定的固定宽度(以像素为单位),这就是为什么不能将表格强制设置为较小的宽度。
i suggest you use percentages as widths for the elements inside the table. 我建议您使用百分比作为表格内元素的宽度。 for example
例如
tbody { width:100%;}
tr { width:100%;}
td { width:50%;}
OR if you want to keep the widths of the elements fixed (873px) you could wrap all the table inside a div like .wrapper
and add 或者,如果您想保持元素的宽度固定(873px),则可以将所有表包装在div之类的
.wrapper
然后添加
.wrapper {
width:600px;
overflow:auto;
}
I did some research to create email templates. 我做了一些研究来创建电子邮件模板。
I hope this will help you in this. 希望对您有帮助。
The steps to create email templates are: 创建电子邮件模板的步骤是:
<style>
in <head>
<head>
<style>
<head>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.