css 打印时td内容太大,无法打印

3phpmpom  于 2022-12-30  发布在  其他
关注(0)|答案(4)|浏览(168)
<tr>       
   <td>
     <table> 
        <tr>
          <td>
              <div>
                 lot of data
              </div>
          </td>
       </tr>
   </table>
 </td>

我可以在a4或其他格式下正常打印。但是,a6纸张大小预览在chrome上加载错误。在Microsoft Edge中工作正常。为什么?

2w2cym1i

2w2cym1i1#

使用自动换行

<table style="table-layout: fixed; width: 100%">
  <tr>
    <td style="word-wrap: break-word">
       lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data lot of data 
    </td>
  </tr>
</table>
erhoui1w

erhoui1w2#

它不像图片中那样打印具有大量数据的部件,它给出了加载预览时的错误。但另一个短的在A6上打印

46scxncf

46scxncf3#

<table style="width:50%; margin: 0 auto;">
        <tr>
            <th>data</th>
        </tr>
        <tr>
            <td>
                <div style="word-break: break-word;">
                    lot of lot of data lot of data lot of data lot of data lot of data lot of data lot of data
                </div>
            </td>
        </tr>
  </table>
jexiocij

jexiocij4#

当我这样做的时候它会打印出来。但是我猜它不适合表格的结构。

<tr>       
   <td>
     <table> 
        <tr>
          <td>
              <div>
                <tr>
                    data
                </tr>
                <tr>
                  lot of data
                </tr>
              </div>
          </td>
       </tr>
   </table>
 </td>

相关问题