JQuery dataTables: export using newline / break string in cell using jQuery

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" }] }, 
+1
jquery jquery-datatables regex newline tabletools
source share

No one has answered this question yet.

See similar questions:

8
Export value using Linebreaks to a separate cell in Excel. jQuery datatables

or similar:

7428
How to check if an element is hidden in jQuery?
4523
"Thinking in AngularJS" if I have jQuery background?
4345
How to check if checkbox is checked in jQuery?
3952
Setting "checked" for checkbox with jQuery?
2644
Is there an "exists" function for jQuery?
2109
Echo newline in Bash prints literally \ n
1741
How to replace a character with a new line in Vim
1675
How to print without a new line or space?
1568
How can I remove the ending line feed?
1258
Why do text files end with a newline?

All Articles