function _fnDetectHeader ( aLayout, nThead )
		{
			var nTrs = $(nThead).children('tr');
			var nTr, nCell;
			var i, k, l, iLen, iColShifted, iColumn, iColspan, iRowspan;
			var bUnique;
			var fnShiftCol = function ( a, i, j ) {
				var k = a[i];
		                while ( k[j] ) {
					j++;
				}
				return j;
			};
		
			aLayout.splice( 0, aLayout.length );
		
			/* We know how many rows there are in the layout - so prep it */
			for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
			{
				aLayout.push( [] );
			}
		
			/* Calculate a layout array */
			for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
			{
				nTr = nTrs[i];
				iColumn = 0;
		
				/* For every cell in the row... */
				nCell = nTr.firstChild;
				while ( nCell ) {
					if ( nCell.nodeName.toUpperCase() == "TD" ||
					     nCell.nodeName.toUpperCase() == "TH" )
					{
						/* Get the col and rowspan attributes from the DOM and sanitise them */
						iColspan = nCell.getAttribute('colspan') * 1;
						iRowspan = nCell.getAttribute('rowspan') * 1;
						iColspan = (!iColspan || iColspan===0 || iColspan===1) ? 1 : iColspan;
						iRowspan = (!iRowspan || iRowspan===0 || iRowspan===1) ? 1 : iRowspan;
		
						/* There might be colspan cells already in this row, so shift our target
						 * accordingly
						 */
						iColShifted = fnShiftCol( aLayout, i, iColumn );
		
						/* Cache calculation for unique columns */
						bUnique = iColspan === 1 ? true : false;
		
						/* If there is col / rowspan, copy the information into the layout grid */
						for ( l=0 ; l<iColspan ; l++ )
						{
							for ( k=0 ; k<iRowspan ; k++ )
							{
								aLayout[i+k][iColShifted+l] = {
									"cell": nCell,
									"unique": bUnique
								};
								aLayout[i+k].nTr = nTr;
							}
						}
					}
					nCell = nCell.nextSibling;
				}
			}
		}
/**
		 * Use the DOM source to create up an array of header cells. The idea here is to
		 * create a layout grid (array) of rows x columns, which contains a reference
		 * to the cell that that point in the grid (regardless of col/rowspan), such that
		 * any column / row could be removed and the new grid constructed
		 *  @param array {object} aLayout Array to store the calculated layout in
		 *  @param {node} nThead The header/footer element for the table
		 *  @memberof DataTable#oApi
		 */
Use the DOM source to create up an array of header cells. The idea here is to
create a layout grid (array) of rows x columns, which contains a reference
to the cell that that point in the grid (regardless of col/rowspan), such that
any column / row could be removed and the new grid constructed
@param array {object} aLayout Array to store the calculated layout in
@param {node} nThead The header/footer element for the table
@memberof DataTable#oApi
Use the DOM source to create up an array of header cells . The idea here is to create a layout grid ( array ) of rows x columns which contains a reference to the cell that that point in the grid ( regardless of col / rowspan ) such that any column / row could be removed and the new grid constructed @param array { object } aLayout Array to store the calculated layout in @param { node } nThead The header / footer element for the table @memberof DataTable#oApi
function _fnDetectHeader ( aLayout, nThead )
		{
			var nTrs = $(nThead).children('tr');
			var nTr, nCell;
			var i, k, l, iLen, iColShifted, iColumn, iColspan, iRowspan;
			var bUnique;
			var fnShiftCol = function ( a, i, j ) {
				var k = a[i];
		                while ( k[j] ) {
					j++;
				}
				return j;
			};
			aLayout.splice( 0, aLayout.length );
			for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
			{
				aLayout.push( [] );
			}
			for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
			{
				nTr = nTrs[i];
				iColumn = 0;
				nCell = nTr.firstChild;
				while ( nCell ) {
					if ( nCell.nodeName.toUpperCase() == "TD" ||
					     nCell.nodeName.toUpperCase() == "TH" )
					{
						iColspan = nCell.getAttribute('colspan') * 1;
						iRowspan = nCell.getAttribute('rowspan') * 1;
						iColspan = (!iColspan || iColspan===0 || iColspan===1) ? 1 : iColspan;
						iRowspan = (!iRowspan || iRowspan===0 || iRowspan===1) ? 1 : iRowspan;
						iColShifted = fnShiftCol( aLayout, i, iColumn );
						bUnique = iColspan === 1 ? true : false;
						for ( l=0 ; l<iColspan ; l++ )
						{
							for ( k=0 ; k<iRowspan ; k++ )
							{
								aLayout[i+k][iColShifted+l] = {
									"cell": nCell,
									"unique": bUnique
								};
								aLayout[i+k].nTr = nTr;
							}
						}
					}
					nCell = nCell.nextSibling;
				}
			}
		}
function _fnDetectHeader ( aLayout , nThead ) { var nTrs = $ ( nThead ) . children ( 'tr' ) ; var nTr , nCell ; var i , k , l , iLen , iColShifted , iColumn , iColspan , iRowspan ; var bUnique ; var fnShiftCol = function ( a , i , j ) { var k = a [ i ] ; while ( k [ j ] ) { j ++ ; } return j ; } ; aLayout . splice ( 0 , aLayout . length ) ; for ( i = 0 , iLen = nTrs . length ; i < iLen ; i ++ ) { aLayout . push ( [ ] ) ; } for ( i = 0 , iLen = nTrs . length ; i < iLen ; i ++ ) { nTr = nTrs [ i ] ; iColumn = 0 ; nCell = nTr . firstChild ; while ( nCell ) { if ( nCell . nodeName . toUpperCase ( ) == "TD" || nCell . nodeName . toUpperCase ( ) == "TH" ) { iColspan = nCell . getAttribute ( 'colspan' ) * 1 ; iRowspan = nCell . getAttribute ( 'rowspan' ) * 1 ; iColspan = ( ! iColspan || iColspan === 0 || iColspan === 1 ) ? 1 : iColspan ; iRowspan = ( ! iRowspan || iRowspan === 0 || iRowspan === 1 ) ? 1 : iRowspan ; iColShifted = fnShiftCol ( aLayout , i , iColumn ) ; bUnique = iColspan === 1 ? true : false ; for ( l = 0 ; l < iColspan ; l ++ ) { for ( k = 0 ; k < iRowspan ; k ++ ) { aLayout [ i + k ] [ iColShifted + l ] = { "cell" : nCell , "unique" : bUnique } ; aLayout [ i + k ] . nTr = nTr ; } } } nCell = nCell . nextSibling ; } } }
Use the DOM source to create up an array of header cells.
Use the DOM source to create up an array of header cells .
/* We know how many rows there are in the layout - so prep it */ /* Calculate a layout array */ /* For every cell in the row... */ /* Get the col and rowspan attributes from the DOM and sanitise them */ /* There might be colspan cells already in this row, so shift our target
						 * accordingly
						 */ /* Cache calculation for unique columns */ /* If there is col / rowspan, copy the information into the layout grid */