intro.js
// Draw table method for drawing the tables out of array of arrays of table cells
Draw table method for drawing the tables out of array of arrays of table cells
Draw table method for drawing the tables out of array of arrays of table cells
function drawTable(rows){
    var heights = rowHeights(rows);
    var widths = colWidths(rows);
    function drawLine(blocks, lineNo){
	return blocks.map(function(block){
	    return block[lineNo];
	}).join("\t");
    }
    function drawRow(row, rowNum){
	var blocks = row.map(function(cell, colNum){
	    return cell.draw(widths[colNum], heights[rowNum]);
	});
	return blocks[0].map(function(_, lineNo){
	    return drawLine(blocks, lineNo);
	}).join("\n");
    }
    return rows.map(drawRow).join("\n");
}
function drawTable ( rows ) { var heights = rowHeights ( rows ) ; var widths = colWidths ( rows ) ; function drawLine ( blocks , lineNo ) { return blocks . map ( function ( block ) { return block [ lineNo ] ; } ) . join ( "\t" ) ; } function drawRow ( row , rowNum ) { var blocks = row . map ( function ( cell , colNum ) { return cell . draw ( widths [ colNum ] , heights [ rowNum ] ) ; } ) ; return blocks [ 0 ] . map ( function ( _ , lineNo ) { return drawLine ( blocks , lineNo ) ; } ) . join ( "\n" ) ; } return rows . map ( drawRow ) . join ( "\n" ) ; }
Draw table method for drawing the tables out of array of arrays of table cells
Draw table method for drawing the tables out of array of arrays of table cells