不用吧,直接用php显示在ie里,再用ie打印好了

解决方案 »

  1.   

    你可以用js来实现打印.
    用php来控制换页.
      

  2.   

    这个最合理的做法是用CSS来控制换页.
      

  3.   

    下边这个页面如何能先在页面中输入每页打印的行数(如:40),再每40行就打印换页,帮忙改改,谢谢!!!
    鞠躬!<html>
    <head>
    <script>
    </script>
    </head>
    <body>
    <?
    $id=mssql_connect('server','sa');
    $db=mssql_select_db('aaa');
    $query="select t_a,t_b,t_c,t_d,t_e,md_f,md_g from t_table";
    $result=mssql_query($query);
    $i=0;
    ?>
    <table border=1 width=900> 
    <tr bgcolor="#c8e3ff">
    <th><font size=2>编号</font></th>
    <th><font size=2>名称</font></th>
    <th><font size=2>年龄</font></th>
    <th><font size=2>学号</font></th>
    <th><font size=2>班级</font></th>
    <th><font size=2>科目</font></th>
    <th><font size=2>考号</font></th></TR><?
    while($r=mssql_fetch_array($result)) {?>
    <form name="bbb">
    <tr>
    <td>
    <font size=2>
    <input type="button" name="goodsno" value="<? echo $r[t_a];?>" onclick="lw(<? echo $i;?>)">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="goodsname" value="<? echo $r[t_b];?>">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="goodsstyle" value="<? echo $r[t_c];?>">
    </font>
    </td>
    <td>
    <font size=2><input type="text" name="passno" value="<? echo $r[t_d];?>">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="goodsclass" value="<? echo $r[t_e];?>">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="makeunit" value="<? echo $r[t_f;?>">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="hgz" value="<? echo $r[t_g];?>">
    </font>
    </td>
    </tr>
    <?
    $i++;}
    ?>
    </table>
    </form>
    </body>
    </html>
      

  4.   

    $lines=40;
    $i=0;
    while($lines*($i+1)<200)
    {
    echo "表头";
    mssql_query("select t_a,t_b,t_c,t_d,t_e,md_f,md_g from t_table limit $i*$lines,$lines");
    echo ...
    }大概这个意思,自己改一改。
      

  5.   

    为什么<th></th>中的内容总在每一页的最后一行显示??能帮我改到每页的最前边去吗???谢谢!!<html>
    <head>
    <script>
    </script>
    </head>
    <body>
    <?
    $id=mssql_connect('server','sa');
    $db=mssql_select_db('aaa');
    $query="select t_a,t_b,t_c,t_d,t_e,md_f,md_g from t_table";
    $result=mssql_query($query);
    $i=0;
    ?>
    <table border=1 width=900> 
    <tr bgcolor="#c8e3ff">
    <th><font size=2>编号</font></th>
    <th><font size=2>名称</font></th>
    <th><font size=2>年龄</font></th>
    <th><font size=2>学号</font></th>
    <th><font size=2>班级</font></th>
    <th><font size=2>科目</font></th>
    <th><font size=2>考号</font></th></TR><?
    $i=0;while($r=mssql_fetch_array($result)) {if($i%$prows+1==1)echo '<tr style="page-break-after:always">  
      <th><font size=2>编号</font></th>
    <th><font size=2>名称</font></th>
    <th><font size=2>年龄</font></th>
    <th><font size=2>学号</font></th>
    <th><font size=2>班级</font></th>
    <th><font size=2>科目</font></th>
    <th><font size=2>考号</font></th>  
      </tr>  ';$i++; ?>
    <form name="bbb">
    <tr>
    <td>
    <font size=2>
    <input type="button" name="goodsno" value="<? echo $r[t_a];?>" onclick="lw(<? echo $i;?>)">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="goodsname" value="<? echo $r[t_b];?>">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="goodsstyle" value="<? echo $r[t_c];?>">
    </font>
    </td>
    <td>
    <font size=2><input type="text" name="passno" value="<? echo $r[t_d];?>">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="goodsclass" value="<? echo $r[t_e];?>">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="makeunit" value="<? echo $r[t_f;?>">
    </font>
    </td>
    <td>
    <font size=2>
    <input type="text" name="hgz" value="<? echo $r[t_g];?>">
    </font>
    </td>
    </tr>
    <?
    $i++;}
    ?>
    </table>
    </form>
    </body>
    </html>