【问题标题】:How to remove search box and pagination from print page in codeIgniter?如何从codeIgniter的打印页面中删除搜索框和分页?
【发布时间】:2018-11-09 05:43:08
【问题描述】:

我在 codeigniter 中使用 Jquery 数据表,现在我想打印网页,但我想删除搜索框和分页 在打印网页期间。我怎样才能做到这一点?到目前为止,这是我的代码

<script type="text/javascript">
    function PrintElem(elem)
    {
        Popup($(elem).html());
    }

    function Popup(data)
    {
        var mywindow = window.open('', 'new div', 'height=400,width=600');
        mywindow.document.write('<html><head><title></title>');
        /*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
        mywindow.document.write('</head><body >');
        mywindow.document.write(data);
        mywindow.document.write('</body></html>');
        mywindow.print();
        mywindow.close();
        return true;
    }
</script>

<input type="button" value="Print" onclick="PrintElem('#yourdiv')" />

【问题讨论】:

    标签: php codeigniter pagination


    【解决方案1】:
    @media print
    {
    .noprint {display:none;}
    }
    

    noprint 类添加到您的搜索框和分页中。

    【讨论】:

      猜你喜欢
      • 2010-10-09
      • 1970-01-01
      • 2012-10-19
      • 1970-01-01
      • 1970-01-01
      • 2021-01-10
      • 2014-06-13
      • 2018-04-23
      相关资源
      最近更新 更多