Strip html doesnt replace non breaking space.
Strip html doesnt replace non breaking space.
park896
Posts: 6Questions: 2Answers: 0
When exporting to csv, excel, pdf, etc if stripHtml is true, the resulting output should replace ' ' with ' '.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Im not sure about that, I would think it just removes the tag itself.
However, if the content being exported has a
\n
or\r\n
after the<br>
, then I would think settingstripNewlines: false
in theexportOptions
setting forcsv
would take care of this, it uses thebuttons.exportData()
, which according to the reference guide..So by default, all new lines are being stripped
Sorry, the formatting stripped out what was between the quotes. The data in my table cell contains a non breaking space &.n.b.s.p. I have stripHtml = true and stripNewlines = true, but the non breaking space is still exported to csv, excel, pdf, etc. The problem is that those applications do not display the content correctly. I would be ok with any solution including passing a format callback function or something like that so that i could format the text myself. Ideally the library would handle it for me, but I understand it cant feasible handle every scenario under the sun. I would prefer not to have to create my own copy of the exportData code and recreate the wheel when the built-in buttons are so close to working for me.
Oh, I see, I thought it was a
<br>
you were specifying, hah, sorry.Well if you're just looking to parse the data when you export it, I had to do something similar to that recently, heres my thread about it.
The only difference was I ended up using the content altering for both the table display and exporting, if you want it to alter the data just while it exports it, you're going to have to take advantage of the
orthogonal
setting within thebuttons.exportData()
.Heres the exact quote you're looking for from the thread I linked above:
I was kinda hoping I could define a custom
orthogonal
data type, then filter on that, but no dice.Attempt: http://live.datatables.net/xoxiraxu/1/edit?js,output
That was exactly what i wanted. I got your sample working using this
http://live.datatables.net/xoxiraxu/2/edit?js,output
you just have to specify the orthogonal property inside an exportOptions property to get it working.
Oh, hahahha, i thought i did, i forgot to throw it inside the exportOptions, oops, glad you saw that