var Immutable = require('immutable');
var Draft = require('draft-js');

var TYPES = require('./TYPES');
var createRow = require('./createRow');

/**
 * Create a new table header
 *
 * @param {String} tableKey
 * @param {Number} countColumns
 * @return {OrderedMap<String:Draft.ContentBlock>}
 */
function createHeader(tableKey, countColumns) {
    var tableHeaderKey = Draft.genNestedKey(tableKey);
    var tableHeaderBlock = new Draft.ContentBlock({
        key: tableHeaderKey,
        type: TYPES.HEADER
    });

    return Immutable.OrderedMap([
        [tableHeaderKey, tableHeaderBlock]
    ])
    .merge(
        createRow(tableHeaderKey, countColumns)
    );
}

module.exports = createHeader;

@@ -456,16 +456,17 @@
     key:
+ 
  tableHe
@@ -500,16 +500,178 @@
 S.HEADER
+,%0A        data: Immutable.Map(%7B%0A            align: Array%0A                .apply(null, Array(10))%0A                .map(function()%7B return TYPES.LEFT; %7D)%0A        %7D)
 %0A    %7D);

Create align data when creating table