JSP table printing method

Source: Internet
Author: User

<% @ Page contenttype = "text/html; charset = GBK" %>
<% @ Page Language = "Java" Import = "Java. util. *" %>

<%
String Path = request. getcontextpath ();
String basepath = request. getscheme () + ": //" + request. getservername () + ":" + request. getserverport () + path + "/";
%>

<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
<HTML>
<Head>
<Title> water distribution ticket </title>
</Head>

// Pay attention to this object

<Object ID = WB Height = 0 width = 0
Classid = CLSID: 8856f961-340a-11d0-a96b-00c04fd705a2 name = WB> </Object>

// Print the Function

<Script language = "JavaScript">
Function printit ()
{
If (confirm ('Are you sure you want to print? ')){

/** Do not print button */
VaR CEN = Document. getelementbyid ("sheet ");
CEN. innerhtml = '';

/** Execute print */
Wb.exe CWB (6, 6)
}
}

</SCRIPT>

<Body>

<Center>

<Table>

<Tr>
<TD Height = "26"> train Date: </TD>
<TD> & nbsp; </TD>
<TD Height = "24"> passenger section: </TD>
<TD> & nbsp; </TD>
</Tr>

.........
<Tr>
<TD Height = "24"> length name: </TD>
<TD> & nbsp; </TD>
<TD> flight attendant Group No.: </TD>
<TD> & nbsp; </TD>
</Tr>

......
<Tr>
<TD> actual quantity (bottle): </TD>
<TD> & nbsp; </TD>
<TD Height = "25"> distributor: (re) </TD>
<TD> & nbsp; </TD>

</Table>
<Center id = "sheet">
<Table>
<Tr>
<TD> <input type = "button" onclick = javascript: printit () value = "print" class = "input2"/> <TD>
</Tr>
</Table>
</Center>
</Form>
<Center>

</Center>
</Body>

</Html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.