如何在数据表title的打印模式下并排设置多个 div。
var table = $('#displayTable').DataTable({
"ordering": false,
data: parsedData.data,
responsive: false,
dom: 'Bfrtip',
buttons: [
{
extend: 'print',
title: $("#rep_header").html(),
footer: true,
customize: function (win) {
$(win.document.body).find('thead').prepend('<div class="header-print">' + $('#dt-header').val() + '</div>');
$(win.document.body).find('table')
.addClass('table table-striped table-bordered')
.css('direction', 'rtl');
$(win.document.body).find('#rep_head_2_con').css('text-align', 'center');
$(win.document.body).find('#rep_head_3_con').css('text-align', 'left');
$(win.document.body).find('#rep_head_3_con').css('vertical-align', 'top');
}
},
HTML:
<div id="rep_header">
<div id="rep_head_1">
<p id="rep_head_1_con">
AAA
<br />
BBB
</p>
</div>
<div id="rep_head_2">
<p id="rep_head_2_con">
AAA
<br />
BBB
</p>
</div>
<div id="rep_head_3">
<p id="rep_head_3_con">
AAA
<br />
BBB
</p>
</div>
</div>
文本对齐很好,但 div(rep_head_1,rep_head_2,rep_head_3)一个在另一个之下,而不是彼此相邻。
交互式爱情
相关分类