Duplicate table row
Dear Friend,
I need your help!
How to duplicate in the table row? I was try and search to forum, but i have not got single solution. Also, i have place my code and screenshot below:
please suggest me friends.
var curDoc = app.documents[0];
var allTables = curDoc.stories.everyItem().tables.everyItem().getElements();
var nTables = allTables.length;
var testID = 0;
for (var t = 0; t < nTables; t++) {
var curTable = allTables
; var allRows = curTable.rows;
var nRows = allRows.length;
for (var r = 0; r < nRows; r++) {
var curRow = allRows
; var iP = curRow.cells[0].insertionPoints[0];
var parTFrameID = iP.parentTextFrames[0].id;
if (testID != 0 && testID != parTFrameID) {
var appliedStyle = allRows[r-1].cells.everyItem().appliedCellStyle = "TBLR";
var addRow = allRows.add(LocationOptions.BEFORE, allRows[r+0]);
//************************I have missing some duplicate code here******************************
//************************Help Need******************************
}
testID = parTFrameID;
}
}
screenshot here:

Thanks in Advance
KS
