看看
http://www.csdn.net/expert/topic/490/490686.xml?temp=.4091303

解决方案 »

  1.   


    比如你有一个层中的内容要打印:
    <script>
     function print(){//加个参数就可以扩展到打印任何内容print(e){};
    var content=page.innerHTML;
    var newWindow = window.open('','','width=640,height=480,scrollbars');
    newWindow.document.write(content);
    newWindow.document.close();
    newWindow.print();
    }
    </script>
    <div id=page ...>hello</div>
    <input type=button value=print onclick=print()>
    //这只是我模拟打印预览的办法,可以再修饰和排版一下,只是模仿我喜欢这样:)祝你好运