1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-19 17:54:14 +01:00

New: New column option - sContentPadding. What this option does is tag on an extra string to the content of the columns in the width calculation table, in order to take account of the fact that 'iii' is actually less wide than 'mm', but DataTables will pick 'iii' as the longer due to the string width. With sContentPadding you can add an extra string to any column to force DataTables to take account of this during the width calculation - the string in sContentPadding is not used anywhere else and is empty by default. This option will remain undocumented for the moment, since I suspect it will confuse more than help, but it is very useful to have around when x-scrolling.

This commit is contained in:
Allan Jardine 2011-05-12 20:23:40 +01:00
parent fcc41bc535
commit 0c493b6789

View File

@ -2540,6 +2540,7 @@
"fnSetData": null,
"sSortDataType": 'std',
"sDefaultContent": null,
"sContentPadding": "",
"nTh": nTh ? nTh : document.createElement('th'),
"nTf": null
};
@ -2609,6 +2610,7 @@
_fnMap( oCol, oOptions, "asSorting" );
_fnMap( oCol, oOptions, "sSortDataType" );
_fnMap( oCol, oOptions, "sDefaultContent" );
_fnMap( oCol, oOptions, "sContentPadding" );
}
/* Cache the data get and set functions for speed */
@ -5560,6 +5562,10 @@
if ( nTd !== null )
{
nTd = nTd.cloneNode(true);
if ( oSettings.aoColumns[i].sContentPadding !== "" )
{
nTd.innerHTML += oSettings.aoColumns[i].sContentPadding;
}
nTr.appendChild( nTd );
}
}