automatic cell size depending on the text

automatic cell size depending on the text

Maxim_1Maxim_1 Posts: 15Questions: 5Answers: 1

How to make automatic cell size depending on the text in datatables buttons?
buttons: [
{
extend: 'excel',
text: 'Экспорт в Excel',
className: 'custom-excel-button',
customize: function (xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
$('col', sheet).eq(6).attr('height', '500px');
},

Answers

  • Maxim_1Maxim_1 Posts: 15Questions: 5Answers: 1

    $('col', sheet).eq(6).attr('height', '500'); and $('col', sheet).eq(6).attr('height', 'auto'); doesn't work too

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    Wait 5 years and two Excel row height questions come along at once!

    I don't know how you do that - you'd need to refer to the Open Spreadsheet specification, or do what I normally do to figure out what is required in the Excel XML - create a simple Excel file, rename to .zip, extract and inspect the XML to find out how to do what you need.

    Allan

Sign In or Register to comment.