0
我正在尝试配置我的Print.css
页,以便当用户想要打印选定页面时,它会以我想要的格式打印。打印CSS对齐表
所以我Index.cshtml
页上我有一个使用col-md-1
col-md-offset-1
,然后我的第二个表是从一个局部视图,但使用col-md-3
col-md-offset-3
并在网页上,他们都是这样完美的显示表:
| Table 1 | | Table 2 |
| ------- | | ------- |
| ------- | | ------- |
| ------- | | ------- |
但是,当我检查我的打印预览,它看起来是这样的:
| Table 1 |
| ------- |
| ------- |
| ------- |
| Table 2 |
| ------- |
| ------- |
| ------- |
现在我有一个<div></div>
标签我的部分观点,我实际上是想给即div
(表2)和实际的表(表1)a class
,这只会影响Print.css,我给他们display:inline-table
财产,但没有奏效。还是同样的结果
这里是我的HTML:
<link href="~/Content/Print.css" rel="stylesheet" media="print" />
<table class="table table-striped col-md-1 col-md-offset-1 print-col">
<caption>Total Sports & Colors</caption>
<tr>
<th>
@Html.DisplayName("Total Sports:")
</th>
<td>
@ViewBag.totalSports
</td>
<td>
<text class="percentages">
@ViewBag.totalSportsPercentage
</text>
</td>
</tr>
<tr>
<th>
@Html.DisplayName("Total Colors:")
</th>
<td>
@ViewBag.totalColors
</td>
<td>
<text class="percentages">
@ViewBag.totalColorsPercentage
</text>
</td>
</tr>
</table>
<div class="print-col">
@Html.Action("Test", "TotalTest")
</div>
这里是我的print-col
类名Print.CSS:
.print-col{
display: inline-table;
}
所以我的问题是,如何让我的表,像我的网页对齐我的print.css?
我很确定打印文档的“视口”小于引导程序中“col-md- *”的视口。 – Quantastical