Last active
August 29, 2015 14:06
-
-
Save lucasfcosta/524288145f1ff6d85ffa to your computer and use it in GitHub Desktop.
Separes Lines of an Array Containing Table Cells' Contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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