I am trying to create an exportable datatable with the jquery.dataTable plugin.
But for design reasons, I need rows in the cells. For the presentation of HTML, I just use <br> , but if I try to export this fe to PDF, it will break the output from the first counter br, so I googled around and tried to preprocess the data and replace the breaks with newlines, but this will result to the fact that PDF export will be split into the first br even for a large number of lines. I have no idea.
Here is part of my attempt:
{ "aButtons": [{ "sExtends": "pdf", "fnCellRender": function ( sValue, iColumn, nTr, iDataIndex ) { return sValue.replace(/<br\s*\/?>/ig, "\r\n") ; }, "sNewLine":"\r\n" }] },
jquery jquery-datatables regex newline tabletools
john smith
source share