У меня есть таблица с ячейками, которые содержат элементы списка, проблема в том, что, когда я печатаю таблицу, я теряю элементы списка, и текст становится очень трудно читать.см. изображения. ![enter image description here](https://i.stack.imgur.com/TzTrm.jpg)
вот мои js для создания таблицы данных, вы можете просто сосредоточиться на части кнопок.
$(document).ajaxSuccess(function() {
qxGenerateDataTables();
});
function qxGenerateDataTables() {
$("table.dataTable:not(table.dataTableProcessed)").each(function() {
var $this = $(this);
var paganation = !$this.hasClass("no-pagination");
var title = $this.attr ("data-file-name");
var excel= !$this.hasClass("no-excel");
var table = $this.DataTable({
"bPaginate": paganation,
"bSort": true,
stateSave: true,
ordering : true,
searching: true,
fixedHeader: true,
columnDefs : [ {
orderable : false,
targets : "no-sort"
} ]
,
dom:'B<"wrapper"iftlp>',
buttons: [
{
extend: 'excelHtml5',
text: '<i style="font-size:24px;color:#337ab7" class="fa fa-file-excel-o fa-2x"></i>',
titleAttr: 'Excel',
title: title,
customize: function( xlsx ) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
$('row:first c', sheet).attr( 's', '55' );
}
},
{
extend: 'print',
text: '<i style="font-size:24px;color:#337ab7" class="fa fa fa-print fa-2x"></i>'
}
]
});
table.buttons().container().appendTo( '#qxDatatable_wrapper .col-sm-6:eq(0)' );
//Surround the table with an outer div, to have the horizontal scroll working properly.
var wrapperDiv = $("<div>", {style:"overflow:auto; width: 100%;"});
$this.before(wrapperDiv);
wrapperDiv.append($this);
//Mark this table as processed.
$this.addClass('dataTableProcessed');
//Just hide the button for now until we find a better way.
if (!excel){
$('.fa-file-excel-o').css( 'display', 'none' );
}
//Hide the table info if pagination is disabled...
if (!paganation){
$('.dataTables_info').css( 'display', 'none' );
}
});
}