function preview(oper) {
if (oper < 10 ) {
bdhtml = window.document.body.innerHTML;//Get the html code of the current page
sprnstr = "";//Set the printing start area
eprnstr = "";//Set the print end area
prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) 18); //Start the code Get html backward
prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));//Get html forward from the end code
window.document.body.innerHTML = prnhtml;
window.print();
window.document.body.innerHTML = bdhtml;
} else {
window.print();
}
}
# outer {
display:table;
height:400px;
#position:relative;
overflow:hidden;
}
#middle {
display:table-cell;
vertical-align:middle;
#position:absolute;
#top:50%;
}
#inner {
#position:relative;
#top: -50%;
}