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:
parent
fcc41bc535
commit
0c493b6789
6
media/js/jquery.dataTables.js
vendored
6
media/js/jquery.dataTables.js
vendored
@ -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 );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user