美好的一天。我有一个数据表,其中我通过跨度放置了一个弹出窗口。单击值时,它应该根据列 ID 显示来自另一个页面的弹出窗口值。该代码运行良好,但问题是当我尝试通过数据表导出按钮导出表值时,包含一些代码的弹出窗口标题也会被复制。我只想下载主要数据。
列代码
<td>
<span class="custom-popover" data-toggle="popover" data-placement="top" data-html="true" title="<b>Title Here</b>" data-content="" data-trainee-id="<?php echo $row['id']; ?>">
<span style="text-decoration: underline blue; color: blue;"><?php echo $row['fname'] . ' ' . $row['sname'] . ' ' . $row['tname'] . ' ' . $row['forname']; ?></span>
</span>
</td>
输出
Title Here" data-content="" data-trainee-id="undefined">Title Here" data-content="" data-trainee-id="xxxxxxx"> [NAME EXTRACTED]
预期输出
[NAME EXTRACTED]
从数据表导出代码
buttons: [
{ extend: 'copy',
text: 'Copy',
className: 'btn btn-muted'},
{ extend: 'csv',
text: 'CSV',
className: 'btn btn-info'},
{ extend: 'excel',
text: 'Excel',
className: 'btn btn-success'},
{ extend: 'pdf',
text: 'PDF',
className: 'btn btn-danger',
extend : 'pdfHtml5',
orientation : 'landscape'
},
{ extend: 'print',
text: 'Print',
className: 'btn btn-warning',
orientation : 'landscape'
}
]
好吧,我能够解决这个问题,这是由于标签造成的。我刚刚将其删除并修复了。