While exporting the contents of table into excel.
While exporting the contents of table into excel.

<tr role="row" class="odd">
<td class="sorting_1" style="white-space: initial;">
<span id="cphMain_rptQnAs1_lblquestion_30">ACM Onboarding and Off Boarding?</span>
</td>
</tr>
Please refer the above code while downloading into excel the span id is also getting downloaded. But i don't want to span id to get download.
For example the output i'm getting in this way "<span id="cphMain_rptQnAs1_lblquestion_30">ACM Onboarding and Off Boarding?</span>"
but i required the output like below.
"ACM Onboarding and Off Boarding?"
This discussion has been closed.
Answers
Hi @sundar pawar ,
By default, DataTables should be stripping the HTML. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
HI Colin,
Please find the test case
https://codepen.io/anon/pen/LvpGOj
Hi Colin,
Kindly refer the below test cases https://codepen.io/anon/pen/LvpGOj
If you want to strip HTML, why do you have "stripHtml: false" ?
Yep, that'll do it
If i remove "stripHtml: false" the HTML contents won't get download. Please refer first record of testcase. Only the contents visible in the table will get download. I want the Anchor tag to be downloaded as well.
Hi @sundar pawar
That's only stripping part of the HTML, so hard for DataTables to make that assumption of what part you want, and what you don't!
To do this, you'll need to use orthogonal data. This is a similar example here - if you look at
myExport
you'll see it's displaying it differently for the export. You'll need to do the same, strip out the bit of HTML you don't want, and return the rest.Cheers,
Colin