【问题标题】:PHP Code To Print Model window printing scroll bar as wellPHP代码打印模态窗口打印滚动条以及
【发布时间】:2016-12-18 12:01:21
【问题描述】:

我正在使用 PHP Bootstrap,并尝试打印模型窗口,我的问题是它使用滚动条打印并跳过滚动条后面的隐藏内容,无论滚动条是否出现,我都需要打印整个内容。打印多页也没关系。

请参考这些截图,

This is my model window content with scrollbar hiding some content

What i get in print preview is this

我只想打印整个内容可能在多个页面上但没有滚动条,

在某些情况下,从模型窗口中移除滚动条选项会使其非常长,因此不是选项。

【问题讨论】:

标签: php jquery html css twitter-bootstrap


【解决方案1】:

从 modal-body 中删除溢出属性,并将溢出-y 样式应用于要在其上制作滚动条的 div 喜欢:

.my-custom-scrollbar {
position: relative;
height: 180px;
overflow-y: auto;
}
.my-table{
display:table;
width: 100%;
}
th,td,tr{
padding: 5px;
border:2px solid;
}
<div class="my-custom-scrollbar">
  <table class="my-table">
    <thead>
      <tr>
        <th scope="col">#</th>
        <th scope="col">First</th>
        <th scope="col">Last</th>
        <th scope="col">Handle</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th scope="row">1</th>
        <td>Mark</td>
        <td>Otto</td>
        <td>@mdo</td>
      </tr>
      <tr>
        <th scope="row">2</th>
        <td>Jacob</td>
        <td>Thornton</td>
        <td>@fat</td>
      </tr>
      <tr>
        <th scope="row">3</th>
        <td>Larry</td>
        <td>the Bird</td>
        <td>@twitter</td>
      </tr>
      <tr>
        <th scope="row">4</th>
        <td>Mark</td>
        <td>Otto</td>
        <td>@mdo</td>
      </tr>
      <tr>
        <th scope="row">5</th>
        <td>Jacob</td>
        <td>Thornton</td>
        <td>@fat</td>
      </tr>
      <tr>
        <th scope="row">6</th>
        <td>Larry</td>
        <td>the Bird</td>
        <td>@twitter</td>
      </tr>
    </tbody>
  </table>

</div>

祝你有美好的一天! :) 谢谢!

【讨论】:

    猜你喜欢
    • 2019-08-01
    • 2021-10-14
    • 1970-01-01
    • 2012-08-24
    • 2023-03-04
    • 2012-08-19
    • 1970-01-01
    • 1970-01-01
    • 2014-01-17
    相关资源
    最近更新 更多