【发布时间】:2017-06-02 15:35:21
【问题描述】:
我的网页上有<table>。在 Google Chrome 上,<table> 显示良好。它的左右两边都有填充。当我打印页面时,它也显示得很好。它适合在纸上。但是当我尝试在 Internet Explorer 或 Mozilla Firefox 中打开页面时,<table> 不适合。没有 padding-right 并且最后一列显示一半。此外,当我打印页面时,最后一列打印一半。
有人知道我该如何解决这个问题吗?
这是我<table>的CSS
table.inventory { clear: both; border: 0px; line-height: 1.2;width: 100%; padding-left:20px; padding-right:20px;font-size: 85%;}
table.inventory th { font-weight: bold; border: 0px;line-height: 1.2;text-align: left; }
table.inventory td:nth-child(1) { border: 0px;line-height: 1.2;width: 47.5%; }
table.inventory td:nth-child(2) { border: 0px;line-height: 1.2;width: 12.5%; }
table.inventory td:nth-child(3) { border: 0px;line-height: 1.2;text-align: right; width: 15%; }
table.inventory td:nth-child(4) { border: 0px;line-height: 1.2;text-align: right; width: 12.5%; }
table.inventory td:nth-child(5) { border: 0px;line-height: 1.2;text-align: right; width: 12.5%; }
【问题讨论】:
-
你能在jsfiddle.net创建例子吗?
-
你能用一些行显示 HTML 吗?
-
你是用 bootstrap 还是别的?
-
如您所见,右侧没有填充