The printer printing function has been implemented in the project recently. Although it is very simple, it is analyzed as follows:
<Div class = "controltitle"> current operation: information Management --> Student Information list --> printing of Student Information </div> <SPAN class = "content_button_a_left" onclick = "printdiv ('div _ print '); "> Print </span> <Div id =" div_print "> <Table class =" tablefirst "id =" radiosub "> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col s Tyle = "width: 5%"/> <Col style = "width: 5%"/> <Col style = "width: 5%"/> <Col style = "width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <Col style =" width: 5% "/> <tr> <TH> Student ID </Th> <TH> name </Th> <TH> gender </Th> <TH> major </Th> <th> Educational System </Th> <TH> admission year </Th> <TH> graduation year </Th> <TH> province and city </Th> <TH> Work Unit </Th> <TH> position </Th> <TH> title </Th> <TH> office phone number </Th> <TH> mobile phone number </Th> <TH> QQ </Th> <TH> email address </Th> <TH> Communication Address </Th> <TH> Home address </Th> </tr> <# If inforlist? Exists> <# list inforlist as infor> <tr> <TD >$ {infor. stunum} </TD> <TD >$ {infor. stuname} </TD> <TD >$ {infor. stusex} </TD> <TD >$ {infor. stuzy} </TD> <TD >$ {infor. stuxz} </TD> <TD >$ {infor. stustarttime }</TD> <TD >$ {infor. stuendtime }</TD> <TD >$ {infor. stuworkaddress }</TD> <TD >$ {infor. stuworkplace }</TD> <TD >$ {infor. stuworkpost} </TD> <TD >$ {infor. stuworkzc }</TD> <TD >$ {infor. stuphone} </TD> <TD >$ {infor. stutelephone }</TD> <TD >$ {infor. stuqq} </TD> <TD >$ {infor. stuemail} </TD> <TD >$ {infor. stucommaddress }</TD> <TD >$ {infor. stuaddress} </TD> </tr> </# list> </# If> </table> </div> <Div class = "shadehiddenblock" id = "subdetail" style = "dispaly: none; "> </div> <SCRIPT> function printdiv (printpage) {var headstr = "<HTML>
In fact, the print operation is to call a piece of JS Code to print the content in a specific Div. This method is very simple.