我有以下问题
正如你在图片中看到的那样
td
最后一个字符3
也会在下一行打印我有谷歌很多关于这个并找到以下解决方案,但它不适用于我在列表谷歌铬和IE9
<style>
@media print
{
body { font-size:small; font-family: myOpenSans, Tahoma; font-size:13px; color:#808080; display:table-row}
table { page-break-after:auto }
tr { page-break-inside:avoid; page-break-after:auto }
td { page-break-inside:avoid; page-break-after:auto }
thead { display:table-header-group }
tfoot { display:table-footer-group }
}
</style>
答案 0 :(得分:0)
我不知道这是否是您要找的,但是您可以从IE打开打印对话框并预定义activex控件中的一些值并删除页面的页脚和标题,如果需要还可以设置边距
function printSpecial() {
try {
var html = '<HTML><HEAD>\n';
if (document.getElementsByTagName != null) {
var headTags = document.getElementsByTagName('head');
if (headTags.length > 0)
html += headTags[0].innerHTML;
}
html += '<BODY style="background-color: #ffffff;">\n';
var printReadyElem = document.getElementById('content');
if (printReadyElem != null) {
html += printReadyElem.innerHTML;
}
else {
alert('Could not find the printReady function');
return;
}
html += '</BODY></HTML>';
shell = new ActiveXObject("WScript.Shell");
shell.sendKeys('%fu'); //brings up page setup
shell.sendKeys("%a{TAB}.2{TAB}0{TAB}0{TAB}0{TAB}0{TAB}0{TAB}{UP}{TAB}{UP}{TAB}{UP}{UP}{UP}{UP}{TAB}{UP}{UP}{ENTER}");
window.setTimeout("shell.SendKeys('%fp')",1000); // brings up print dialog
} catch (e) {
alert ("An exception occured: " + e + "\nCode is: " + e.number + "\nDescription is: " + e.description);
alert('Please verify that your print settings have a Landscape orientation.');
}
}