为什么我class
的添加text-align
不起作用@media print
?
我做了一个示例 PLUNKER
我希望Right Element
当用户点击Print
按钮时保持正确
风格
@media print {
td.text-right-print {
text-align: right!important
}
}
桌子
<table class="table" id="example">
<thead>
<tr>
<th>Left Thead</th>
<th>Right Thead</th>
</tr>
</thead>
<tbody>
<tr>
<td>Left Element</td>
<td align="right" class="text-right-print">Right Element</td>
</tr>
<tbody>
</table>
谢谢!
可以使用customize
jquery数据表的方法。
$(document).ready(function() {
$('#example').DataTable({
dom: 'Bfrtip',
buttons: [
{
extend: 'print',
customize: function ( win ) {
$(win.document.body).find('table tr td:nth-child(2)')
.addClass('rightAlign');
}
}
]
});
});
请找到以下链接以获取更多信息:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句