Hi,
thanks for your post, and sorry for the trouble.
Yes, this should work. First, you could drag the “Custom Commands” box a bit bigger and then add something like what you see on that page:
"buttons": [
{
"extend": "copyHtml5",
"exportOptions": {
"columns": [ 0, ":visible" ]
}
},
{
"extend": "excelHtml5",
"exportOptions": {
"columns": ":visible"
}
},
{
"extend": "pdfHtml5",
"exportOptions": {
"columns": [ 0, 1, 2, 5 ]
}
},
"colvis"
]
(I recommend to write proper JSON code, with " around the text strings.)
Regards,
Tobias
Perfect – this does the exactly the job I wanted. Thank you very much.
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
Hi,
I want only columns 1,2,3,4 to be visible and 1st column to make invisible in the pdf. I wrote the code as below but it made my search bar and pdf button to disappear.
can you please suggest if i made anything wrong.
“buttons”: [
{
“extend”: “pdfHtml5”,
“exportOptions”: {
“columns”: [ 1,2,3,4 ]
}
}
]
Thanks
Sugandha
Hi Sugandha,
Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!
Regards,
Tobias
Hi,
I’m afraid that I can not access that URL, because it’s in the private IP address sector :-/ It’s probably only reachable from your local intranet.
Regards,
Tobias
I did fixed the code. Thanks
Hi,
great, good to hear that it’s working now!
Best wishes,
Tobias