简体   繁体   English

如何打破 HTML 旋转表的页面

[英]How to break page of Rotated table of HTML

在此处输入图像描述

I have rotated table of HTML on my page and on print preview tables are displaying horizontally but data is dynamically fetching in while loop and page is showing limited records overflowed data is not displaying on next page and page is not breaking automatically.我在我的页面上旋转了 HTML 表,并且打印预览表水平显示,但数据在 while 循环中动态获取,页面显示有限的记录溢出数据未显示在下一页上,并且页面不会自动中断。

<tr style="font-size:12px;text-align:center">
                                <th class=""><span class="">1</span></th>
                                <th class=""><span class="">2</span></th>
                                <th class=""><span class="">3</span></th>
                                <th class=""><span class="">4</span></th>
                                <th class=""><span class="">5</span></th>
                                <th class=""><span class="">6</span></th>
                                <th class=""><span class="">7</span></th>
                                <th class=""><span class="">8</span></th>
                                <th class=""><span class="">9</span></th>
                                <th class=""><span class="">10</span></th>
                                <th class=""><span class="">11</span></th>
                            </tr>
                            </thead>
                            <tbody>
            <?php  
                dbcon1();
                $sql=mysql_query("select * from medical_temp where medi_pf_number='$pf'");
                while($result=mysql_fetch_array($sql))
                {
                    echo "<tr style='height:15px;border-left:none'><td colspan='11'>".$result['medi_remark']."</td></tr>";
                }
?>

// css rotation code

.pb {
          page-break-before: always;
        }
#abc {
             // -webkit-transform: rotate(90deg);
             // -moz-transform: rotate(90deg);   
             // -ms-transform: rotate(90deg);   /* IE 9 */
             // -o-transform: rotate(90deg);   /* Opera */
             // transform: rotate(90deg);
            height:1500px;
            width:100%;
            padding:500px;
            padding-top:360px;
            padding-left:320px;
            margin-right:-550px;
            margin-top:-10px;
            page-break-inside:avoid;
            }
              #p1 {display: none;}
            }

Instead of rotating the table set a proper @media print {} rule in css in order to print a landscape page.为了打印横向页面,而不是旋转表格,而是在 css 中设置适当的 @media print {} 规则。

You can find something here ( Landscape printing from HTML )你可以在这里找到一些东西( 从 HTML 横向打印

To print a overflowed table you have to set the proper css breaks.要打印溢出的表格,您必须设置正确的 css 中断。

table { page-break-inside:auto }
tr    { page-break-inside:avoid; page-break-after:auto }

/* put your header in a thead in order to print it every 
   time a new page is created */ 
thead { display:table-header-group }
/* for table footers */ 
tfoot { display:table-footer-group }

source: How to deal with page breaks when printing a large HTML table来源: 打印大型 HTML 表格时如何处理分页符

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM