AutoFit Column Width when exporting to Excel

AutoFit Column Width when exporting to Excel

niksdopeniksdope Posts: 2Questions: 1Answers: 0
edited March 2019 in Free community support

Hey,

Is it possible to set columns to AutoFit Width when exporting to Excel?
I'm running into a problem with currency column data displaying as ###### because the column width is too small. I can set the column width manually but it'd be great to be able to make it fit to the max data size automatically.

I found a previous discussion about this (https://datatables.net/forums/discussion/23147/auto-fit-for-excel-columns-while-exporting-from-data-table-using-tabletools) but there was no answer and the thread was closed.

Thanks,
Niks

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @niksdope ,

    The options for the Excel customisations are on this page here. It says it attempts to auto-size automatically - if that's not happening, I suspect you'll have to dive into the links at the end of the "Customisation" section.

    Cheers,

    Colin

  • niksdopeniksdope Posts: 2Questions: 1Answers: 0

    A change to _excelColWidth in a newer version of buttons.html5.js fixed this.

This discussion has been closed.