booking/DataTables/datatables.js
/**
 * Get the width for an Excel column based on the contents of that column
 * @param  {object} data Data for export
 * @param  {int}    col  Column index
 * @return {int}         Column width
 */
Get the width for an Excel column based on the contents of that column
@param  {object} data Data for export
@param  {int}    col  Column index
@return {int}         Column width
Get the width for an Excel column based on the contents of that column @param { object } data Data for export @param { int } col Column index @return { int } Column width
function _excelColWidth( data, col ) {
	var max = data.header[col].length;
	var len, lineSplit, str;
	if ( data.footer && data.footer[col].length > max ) {
		max = data.footer[col].length;
	}
	for ( var i=0, ien=data.body.length ; i<ien ; i++ ) {
		var point = data.body[i][col];
		str = point !== null && point !== undefined ?
			point.toString() :
			'';
		if ( str.indexOf('\n') !== -1 ) {
			lineSplit = str.split('\n');
			lineSplit.sort( function (a, b) {
				return b.length - a.length;
			} );
			len = lineSplit[0].length;
		}
		else {
			len = str.length;
		}
		if ( len > max ) {
			max = len;
		}
		if ( max > 40 ) {
			return 52; 
		}
	}
	max *= 1.3;
	return max > 6 ? max : 6;
}
function _excelColWidth ( data , col ) { var max = data . header [ col ] . length ; var len , lineSplit , str ; if ( data . footer && data . footer [ col ] . length > max ) { max = data . footer [ col ] . length ; } for ( var i = 0 , ien = data . body . length ; i < ien ; i ++ ) { var point = data . body [ i ] [ col ] ; str = point !== null && point !== undefined ? point . toString ( ) : '' ; if ( str . indexOf ( '\n' ) !== - 1 ) { lineSplit = str . split ( '\n' ) ; lineSplit . sort ( function ( a , b ) { return b . length - a . length ; } ) ; len = lineSplit [ 0 ] . length ; } else { len = str . length ; } if ( len > max ) { max = len ; } if ( max > 40 ) { return 52 ; } } max *= 1.3 ; return max > 6 ? max : 6 ; }
Get the width for an Excel column based on the contents of that column
 @param  {object} data Data for export
 @param  {int}    col  Column index
 @return {int}         Column width
Get the width for an Excel column based on the contents of that column @param { object } data Data for export @param { int } col Column index @return { int } Column width
// If there is a newline character, workout the width of the column // based on the longest line in the string // Max width rather than having potentially massive column widths // 40 * 1.3 // And a min width