[英]Print: Div side by side
我需要你的幫助。 我有一個表格,並排2格(左右),為2列。
<div class="row">
<div class="col-lg-12" id="printable">
<div class="col-lg-6">
<form role="form"></form>
</div>
<div class="col-lg-6">
<form role="form"></form>
</div>
</div>
</div>
我有兩個JavaScript來打印那些div
<script type="text/javascript">
function printDiv_1(divName) {
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
function PrintDiv_2() {
var divContents = document.getElementById("printdivcontent").innerHTML;
var printWindow = window.open('', '', 'height=200,width=400');
printWindow.document.write('<html><head><title>Print DIV Content</title>');
printWindow.document.write('</head><body >');
printWindow.document.write(divContents);
printWindow.document.write('</body></html>');
printWindow.document.close();
printWindow.print();
}
但pdf文件格式的結果始終按從上到下的順序排列。 變成2行。
如何克服這個問題? 我認為,javascript中有些東西我想念的。
感謝Adv。
<div class="row" id="printable">
<div class="col-lg-6">
<form role="form"></form>
</div>
<div class="col-lg-6">
<form role="form"></form>
</div>
</div>
如果在行類之后創建一列(col-lg-12),則該行將變得無用。
這是因為col-lg-12
與BootStrap行大小相等。 所有列類
col-md-12 , col-sm-12, col-xs-12
所有這些都將以相同的方式作用於不同的大小。
而且不要忘了,如果您想在一行中包含一些元素,請使總數等於12
例如,
col-md-6 and col-md-6
col-md-4 and col-md-8
因此,兩個col-*-*
總和為12,它們將並排放置。
如果元素的總和大於12,則后面的元素將位於第一個元素的正下方
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.