Bootstrap 表在打印时显示灰色水平滚动条
我正在尝试打印带有引导表的网页。但是当我按 command/ctrl + P 时,会出现水平滚动条。我不明白它来自哪里。
我可以看到桌子下面有一些空间(蓝色棚子内)。这就是滚动条出现的地方。
按 command/ctrl + P 后,我得到类似这样的信息。
如何摆脱这个滚动条?
这是一个非常简单的例子。不过,这里是代码。
@page {
size: auto;
margin: 7mm;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i&display=swap">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://unpkg.com/@bootstrapstudio/bootstrap-better-nav/dist/bootstrap-better-nav.min.css">
<div class="row mt-3">
<div class="col">
<div class="table-responsive">
<table class="table table-striped table-sm">
<tbody>
<tr>
<td class="font-weight-bold f14" style="border: 1px solid #dee2e6;">Total Paid
</td>
<td>$ 5,023.00</td>
</tr>
<tr>
<td class="font-weight-bold f14" style="border: 1px solid #dee2e6;">Invoice Date
</td>
<td class="f14" style="border: 1px solid #dee2e6;">11-11-2022</td>
</tr>
<tr>
<td class="font-weight-bold f14" style="border: 1px solid #dee2e6;">Invoice #</td>
<td class="f14" style="border: 1px solid #dee2e6;">11</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
I am trying to print a webpage with bootstrap tables. But when I press command/ctrl + P, a horizontal scroll bar appears. I am not getting where it is coming from.
I can see some space below the table (within the blue shed). That is where the scroll bar appears.
After pressing command/ctrl + P, I get something like this.
How can I get rid of this scroll bar?
It is a quite straightforward example. Still, here is the code.
@page {
size: auto;
margin: 7mm;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i&display=swap">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://unpkg.com/@bootstrapstudio/bootstrap-better-nav/dist/bootstrap-better-nav.min.css">
<div class="row mt-3">
<div class="col">
<div class="table-responsive">
<table class="table table-striped table-sm">
<tbody>
<tr>
<td class="font-weight-bold f14" style="border: 1px solid #dee2e6;">Total Paid
</td>
<td>$ 5,023.00</td>
</tr>
<tr>
<td class="font-weight-bold f14" style="border: 1px solid #dee2e6;">Invoice Date
</td>
<td class="f14" style="border: 1px solid #dee2e6;">11-11-2022</td>
</tr>
<tr>
<td class="font-weight-bold f14" style="border: 1px solid #dee2e6;">Invoice #</td>
<td class="f14" style="border: 1px solid #dee2e6;">11</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,这是一个滚动条。所以我试图隐藏它并且它起作用了。要从表格中删除滚动条,请将此 CSS 添加到该表格中。
它应该消失
Actually, this is a scrollbar. So I tried to hide it and it worked. To get rid of the scroll bar from the table add this CSS to that table.
And it should go away