• <legend id='rqNHe'><style id='rqNHe'><dir id='rqNHe'><q id='rqNHe'></q></dir></style></legend><tfoot id='rqNHe'></tfoot>

      <small id='rqNHe'></small><noframes id='rqNHe'>

    1. <i id='rqNHe'><tr id='rqNHe'><dt id='rqNHe'><q id='rqNHe'><span id='rqNHe'><b id='rqNHe'><form id='rqNHe'><ins id='rqNHe'></ins><ul id='rqNHe'></ul><sub id='rqNHe'></sub></form><legend id='rqNHe'></legend><bdo id='rqNHe'><pre id='rqNHe'><center id='rqNHe'></center></pre></bdo></b><th id='rqNHe'></th></span></q></dt></tr></i><div id='rqNHe'><tfoot id='rqNHe'></tfoot><dl id='rqNHe'><fieldset id='rqNHe'></fieldset></dl></div>
        <bdo id='rqNHe'></bdo><ul id='rqNHe'></ul>
      1. layui打印表格自定义函数

        时间:2024-10-16
        • <tfoot id='yTjhG'></tfoot>

              <tbody id='yTjhG'></tbody>
            <i id='yTjhG'><tr id='yTjhG'><dt id='yTjhG'><q id='yTjhG'><span id='yTjhG'><b id='yTjhG'><form id='yTjhG'><ins id='yTjhG'></ins><ul id='yTjhG'></ul><sub id='yTjhG'></sub></form><legend id='yTjhG'></legend><bdo id='yTjhG'><pre id='yTjhG'><center id='yTjhG'></center></pre></bdo></b><th id='yTjhG'></th></span></q></dt></tr></i><div id='yTjhG'><tfoot id='yTjhG'></tfoot><dl id='yTjhG'><fieldset id='yTjhG'></fieldset></dl></div>

            <small id='yTjhG'></small><noframes id='yTjhG'>

                <bdo id='yTjhG'></bdo><ul id='yTjhG'></ul>
                1. <legend id='yTjhG'><style id='yTjhG'><dir id='yTjhG'><q id='yTjhG'></q></dir></style></legend>
                  最终实现打印效果如下:


                  具体函数如下:
                   
                  function print (tablelayid)
                  {
                      var v = document.createElement("div");
                      var f = ["<head>", "<style>", "body{font-size: 12px; color: #666;}", "table{width: 100%; border-collapse: collapse; border-spacing: 0;}", "th,td{line-height: 20px; padding: 9px 15px; border: 1px solid #ccc; text-align: left; font-size: 12px; color: #666;}", "a{color: #666; text-decoration:none;}", "*.layui-hide{display: none}", "</style>", "</head>"].join("");
                      $(v).append($(".layui-table-box").find(".layui-table-header").html());
                      $(v).find("tr").after($("[lay-id=\"" + tablelayid+ "\"] .layui-table-body.layui-table-main table").html()); $(v).find("th.layui-table-patch").remove();
                      $(v).find(".layui-table-col-special").remove();
                      var h = window.open("打印窗口", "_blank");
                      h.document.write(f + $(v).prop("outerHTML"));
                      h.document.close();
                      h.print();
                      h.close();
                  }
                   
                  上一篇:layer.open打印iframe内容的方法 下一篇:没有了

                  相关文章

                2. <legend id='2kYsz'><style id='2kYsz'><dir id='2kYsz'><q id='2kYsz'></q></dir></style></legend>

                  <small id='2kYsz'></small><noframes id='2kYsz'>

                3. <tfoot id='2kYsz'></tfoot>

                      <i id='2kYsz'><tr id='2kYsz'><dt id='2kYsz'><q id='2kYsz'><span id='2kYsz'><b id='2kYsz'><form id='2kYsz'><ins id='2kYsz'></ins><ul id='2kYsz'></ul><sub id='2kYsz'></sub></form><legend id='2kYsz'></legend><bdo id='2kYsz'><pre id='2kYsz'><center id='2kYsz'></center></pre></bdo></b><th id='2kYsz'></th></span></q></dt></tr></i><div id='2kYsz'><tfoot id='2kYsz'></tfoot><dl id='2kYsz'><fieldset id='2kYsz'></fieldset></dl></div>
                        <bdo id='2kYsz'></bdo><ul id='2kYsz'></ul>