function _fnHeaderLayout(settings, source, incColumns) {
		var row, column, cell;
		var local = [];
		var structure = [];
		var columns = settings.aoColumns;
		var columnCount = columns.length;
		var rowspan, colspan;

		if (!source) {
			return;
		}

		// Default is to work on only visible columns
		if (!incColumns) {
			incColumns = _range(columnCount)
				.filter(function (idx) {
					return columns[idx].bVisible;
				});
		}

		// Make a copy of the master layout array, but with only the columns we want
		for (row = 0; row < source.length; row++) {
			// Remove any columns we haven't selected
			local[row] = source[row].slice().filter(function (cell, i) {
				return incColumns.includes(i);
			});

			// Prep the structure array - it needs an element for each row
			structure.push([]);
		}

		for (row = 0; row < local.length; row++) {
			for (column = 0; column < local[row].length; column++) {
				rowspan = 1;
				colspan = 1;

				// Check to see if there is already a cell (row/colspan) covering our target
				// insert point. If there is, then there is nothing to do.
				if (structure[row][column] === undefined) {
					cell = local[row][column].cell;

					// Expand for rowspan
					while (
						local[row + rowspan] !== undefined &&
						local[row][column].cell == local[row + rowspan][column].cell
					) {
						structure[row + rowspan][column] = null;
						rowspan++;
					}

					// And for colspan
					while (
						local[row][column + colspan] !== undefined &&
						local[row][column].cell == local[row][column + colspan].cell
					) {
						// Which also needs to go over rows
						for (var k = 0; k < rowspan; k++) {
							structure[row + k][column + colspan] = null;
						}

						colspan++;
					}

					structure[row][column] = {
						cell: cell,
						colspan: colspan,
						rowspan: rowspan,
						title: $('span.dt-column-title', cell).html()
					};
				}
			}
		}

		return structure;
	}
Build a layout structure for a header or footer

@param {*} settings DataTables settings
@param {*} source Source layout array
@param {*} incColumns What columns should be included
@returns Layout array