Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 85594

Re: Delete entire row if any cell is blank

$
0
0

Hi steviej147,

 

Try the below codes, I hope it will helpful for you.

 

var myDoc = app.activeDocument;
var myStories = myDoc.stories.everyItem();
var myTables = myStories.tables.everyItem().getElements();

//--------------Below lines are delete the row,
for(i=0; i<myTables.length;i++){    var myRows = myTables[i].rows;    for(r=myRows.length-1; r>=0; r--){        if(myRows[r].cells.everyItem().texts.everyItem().contents.join("") ==""){            myRows[r].remove();            }        }    }

//------------------Below lines are delte the column
for(i=0; i<myTables.length;i++){    var myRows = myTables[i].columns;    for(r=myRows.length-1; r>=0; r--){        if(myRows[r].cells.everyItem().texts.everyItem().contents.join("") ==""){            myRows[r].remove();            }        }    }

 

 

thx,

csm_phil


Viewing all articles
Browse latest Browse all 85594

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>