HTML Excel Export Question
HTML Excel Export Question
Is it possible to tell HTML Excel Export how to define a column in a table?
When DataTables dynamically determines a cells type you can get columns that are a mix of numbers seen as "text", which they are as they have leading 0's or / in the string, and real numbers. So some are left aligned and some are right aligned when loaded into Excel.
We would like to be able to tel DataTables that the column is say, text or numbers and not determine the type on a cell by cell basis.
thanks
Ken
This question has an accepted answers - jump to answer
Answers
Allan,
Do you have any comment on this question please?
Ken
you can use the customize as shown here: https://datatables.net/extensions/buttons/examples/html5/excelCellShading.html to access and customize your excel before it is downloaded, however, you need to know how to apply Open Spreadsheet standards to make it happen. Allan talks about it a little bit here https://datatables.net/forums/discussion/33415/format-excel-file-from-export
Yup, exactly what @bindrid says!
Alan,
I have now looked at the "customize" attribute and style 50 on page https://datatables.net/reference/button/excelHtml5 but I am still a little hazy as to how I can impact that onto a single column.
Any hints?
Thanks
Ken
This example and the other Excel customise examples, show how it might be done. Basically you need to use jQuery to select the required cells from the generated XML.
Allan
Thanks Allan.