Skip to content

Instantly share code, notes, and snippets.

@lucasfcosta
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasfcosta/524288145f1ff6d85ffa to your computer and use it in GitHub Desktop.
Save lucasfcosta/524288145f1ff6d85ffa to your computer and use it in GitHub Desktop.
Separes Lines of an Array Containing Table Cells' Contents
function separeLines(table, tableCol) {
var lines = [];
var divisionNumber = table.length/tableCol;
var startPos = 0;
var endPos = 0 + tableCol;
for(var i = 0; i < divisionNumber; i++) {
lines.push(table.slice(startPos, endPos));
startPos += tableCol;
endPos += tableCol;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment