function Preview (partial) {
If (partial <10) {
bdhtml = partial writable Doc ument. body. innerhtml; // obtain the HTML Code
sprnstr = " "; // set the print start area
eprnstr =" "; // you can specify the print end area.
prnhtml = bdhtml. substring (bdhtml. indexof (sprnstr) + 18); // obtain HTML from the start Code
Prnhtml = prnhtml. substring (0, prnhtml. indexof (eprnstr); // retrieves HTML from the end code
Too many Doc ument. Body. innerhtml = prnhtml;
Window. Print ();
Required parameter Doc ument. 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%;
}
<Div id = "outer">
<Div id = "Middle">
<Div id = "inner">
<! -Here is the content to be vertically centered->
</Div>
</Div>
</Div>