简体   繁体   中英

DataTables export CSV with html Tag

DataTables.net Here facing issue while export into csv only generating plain Text and Ignoring html tag like

<b></b>, <img src="">

how to include html tag too in export

Try look at the docs -> https://datatables.net/reference/api/buttons.exportData()

Your html is removed because stripHtml by default is true . You can change that through exportOptions / exportData :

$('#example').DataTable( {
  dom: 'Bfrtip',
  buttons: [{
    extend: 'csvHtml5',
    exportOptions: { stripHtml: false } 
  }]
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM