JS achieve a simple page Print

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
	 Print approval page  
</title>
 <style type="text/css">
#dysp
{
	margin:0px;
	padding:10px;
	overflow:auto;
	color:#000;
	width:760px;
}
#dysp h1
{
	text-align:center;
}
#dysp p.sp1
{
	padding:0px;
	margin:2px 0px;
	text-align:left;
}
#dysp table
{
	border:solid 1px #000;
	border-collapse:collapse;
	margin-bottom:10px;
}
#dysp table td
{
	border:solid 1px #000;
	text-align:left;
}

#dysp table th
{
	padding:5px 0px;
	border:solid 1px #000;
}
</style>
<script language="Javascript" type="text/javascript"> 
function preview(index)
{
     bdhtml=window.document.body.innerHTML;
            sprnstr="<!--startprint-->";
            eprnstr="<!--endprint-->";
            prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
            prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
            window.document.body.innerHTML=prnhtml;
            window.print(); 
}
</script>
</head>
<body>
<div>                         
<!--startprint-->
<div>
    <table>
        <tr>
            <th> Start time  </th>
            <th> End time  </th>
            <th> Job content  </th>
            <th> Note  </th>
        </tr>        
        <tr>
            <td>2009-05-14</td>
            <td>2009-05-14</td>
            <td>aaaaaaaaaaaaaaaaaa </td>
            <td></td>            
        </tr>  
	<tr>
            <td>2009-05-14</td>
            <td>2009-05-14</td>
            <td>aaaaaaaaaaaaaaaaaa </td>
            <td></td>            
        </tr> 
	<tr>
            <td>2009-05-14</td>
            <td>2009-05-14</td>
            <td>aaaaaaaaaaaaaaaaaa </td>
            <td></td>            
        </tr>   
	<tr>
            <td>2009-05-14</td>
            <td>2009-05-14</td>
            <td>aaaaaaaaaaaaaaaaaa </td>
            <td></td>            
        </tr> 
	<tr>
            <td>2009-05-14</td>
            <td>2009-05-14</td>
            <td>aaaaaaaaaaaaaaaaaa </td>
            <td></td>            
        </tr>               
    <!--endprint-->
   
    <p><input type="button" value=" Print  " 
   /></p>
</div>
    </div>
    </form>
</body>
</html>
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of JS achieve a simple page Print

  • hibernate call stored procedure

    hibernate call stored procedure

  • hibernate using c3p0 connection pooling

    Private http://www.lifevv.com/tenyo/doc/20070605102040991.html c3p0 for open source's JDBC connection pool, with the release hibernate. This article describes how to use the hibernate configuration in c3p0. c3p0 connection pool configuration is v ...

  • Hibernate configuration parameters hibernate.hbm2ddl.auto

    Hibernate in the configuration file: <properties> <property name="hibernate.hbm2ddl.auto" value="create" /> </ properties> Parameter Description: validate load hibernate, the authentication to create a database t ...

  • Build flex + spring + blazeds + hibernate application

    Build flex + spring + blazeds + hibernate application First, set up the project blazeds 1, will blazeds.war extract to a directory, such as: myflex /; 2, set up java works were such as: MyFlex, in the orientation of selection create project from exis ...

  • Process migration from tomcat to websphere changes

    Process migration from tomcat to websphere changes Because customers use the web application server software used by different what tomcat5, tomcat6, websphere5.1, websphere6.1, weblogic8, and so on, and the software used inconsistent standards, ibm& ...

  • Hibernate connection pool configuration

    Hibernate connection pool configuration <! - Jdbc -> <property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property> <property name="connection.url"> jdbc: oracle: thin: @ 10.203.14.1 ...

  • hibernate generic generic DAO

    hibernate generic generic DAO

  • Struts2 + hibernate + spring problem user log in

    dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q

  • Hibernate secondary cache

    Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...

  • Hibernate's lazy strategy

    hibernate Lazy strategy can be used in: <class> tag, it can be true / false Tags can <PROPERTY> values true / false type of necessary tools to enhance <set> <list> can tag values true / false / extra <many-to-one> <on ...

Leave a Reply

Recent
Recent Entries
Tag Cloud
Random Entries