Topic: Export datatable to Excel
PiotrMD priority asked 1 year ago
Hi,
I'm trying to export data from datatable. Anyway all export methods I found rely on id of table. So when I add id to table it does not work, returns null when referencing. If I delete upper div with class="datatable" then it works. So question how to add id to table when using datatable or how to get data from it ?Does class="datatable" prevent to add id of table inside ?
<div class="datatable">
<table class="table" id="myTable">
<thead>...
Regards
Mateusz Lazaru staff answered 1 year ago
I think it does not really 'prevent' from adding an id to the table, but it creates a new table with new structure and for some reason it does not pass id
attr to the newly created table
element.
Check my snippet: https://mdbootstrap.com/snippets/standard/mlazaru/5197137#js-tab-view
I've selected the table
element and manually added the id
attribute. It's not a perfect solution, but it should work, so treat it like a temporary workaround.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 6.2.0
- Device: Dell Laptop
- Browser: Edge
- OS: Windows 10
- Provided sample code: No
- Provided link: No