I'm trying to display an HTML DataTables URL to the actual image in an Excel column.
Right now, when I export the DataTable to Excel it populates the corresponding column with the URL itself, what I want to achieve is to actually populate the Excel column with the Image, not the Image URL.
Right now, I can see the image for the comment.screenshot variable into HTML, but in Excel, it is blank, while for the rest of comment.screenshot1,comment.screenshot2 and comment.screenshot3, only the URL is populated in Excel.
jQuery:
$("#tableComments").DataTable({
stripHtml: !1,
dom: "Bfrtip",
buttons: ["copyHtml5", "excelHtml5", "csvHtml5", "pdfHtml5"]
})
HTML:
<table id="tableComments" class="display table table-info table-striped">
<thead>
<tr>
<th>User</th>
<th>Version</th>
<th>Round</th>
<th>Comment</th>
<th>Screenshot #1</th>
<th>Screenshot #2</th>
<th>Screenshot #3</th>
<th>Screenshot #4</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{% for comment in comments %}
<tr>
<td>{{ comment.user.username }}</td>
<td>{{ comment.versionName }}</td>
<td>{{ comment.round }}</td>
<td>{{ comment.comment }}</td>
<td><img src="{{ comment.screenshot }}" /></td>
<td>{{ comment.screenshot1 }}</td>
<td>{{ comment.screenshot2 }}</td>
<td>{{ comment.screenshot3 }}</td>
<td>{{ comment.approved }}</td>
</tr>
{% endfor %}
</tbody>
</table>
I highly appreciate your help!
question from:
https://stackoverflow.com/questions/65828976/export-html-datatable-to-excel-display-url-to-image-in-excel 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…