Mio*_*vic 6 css media-queries twitter-bootstrap-3
我有一些 @media print 用于打印我的页面内容,但是当我尝试 ptint 我的页表截断时,我对 boostrap class .responsive-table有问题?
我有一些在 bootstrap 中打印响应式表格的解决方案 这是我现在的 css
@media print {
#top-navigation{
display:none !important;
}
footer{
display:none !important;
}
.main-footer-sub{
display:none !important;
}
a[href]:after {
content: none !important;
}
.hotel-detail-sidebar{
display: none !important;
}
#menu-navigation{
display:none !important;
}
#carousel{
display:none !important;
}
#preporuka-agencije{
display:none !important;
}
#preporuka-agencije{
display:none !important;
}
#offers-sugessted{
display:none !important;
}
#share-buttons{
display:none !important;
}
.tab-content > .tab-pane {
display: block !important;
opacity: 1 !important;
visibility: visible !important;
}
.responsive-tabs{
display:none !important;}
.sattravel-kontakt{
display:none !important;}
.table-responsive{
overflow:visible !important;
}
*,
*:before,enter code here
*:after {
color: #000 !important;
text-shadow: none !important;
background: transparent !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
a[href^="#"]:after,
a[href^="javascript:"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
select {
background: #fff !important;
}
.navbar {
display: none;
}
.btn > .caret,
.dropup > .btn > .caret {
border-top-color: #000 !important;
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table td,
.table th {
background-color: #fff !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
.container {
width:100% !important;
}
}
Run Code Online (Sandbox Code Playgroud)
我的最佳解决方案
table只需用外层包裹主体即可table.tabel-responsive
超文本标记语言
<table class="table table-responsive">
<tr>
<td>
<!-- TABLE TO PRINT -->
<table id="attendance_table" class="table table-bordered bg-warning-o-10">
</table>
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
CSS
@media print {
body * {
visibility: hidden;
}
#attendance_table, #attendance_table * {
visibility: visible;
}
#attendance_table {
position: absolute;
left: 0;
top: 0;
}
}
Run Code Online (Sandbox Code Playgroud)