As you are referring to a table in a XFA form, you can use the following script to remove the instances of empty rows in a table, supposing the repeatable row is called Row1. You can place the script in the layout:ready event of the table:
var n = Row1.instanceManager.count;
for(var i = n - 1; i >= 0; i--){
var notEmpty = false;
var oR = xfa.resolveNode("Row1[" + i + "]");
var allChildElements = oR.nodes;
var intNumElements = allChildElements.length;
for (j = 0; j < intNumElements; j++) {
var currentElement = allChildElements.item(j);
if (currentElement.className == "field") {
if(currentElement.rawValue != "" && currentElement.rawValue != null){
notEmpty = true;
}
}
}
if(notEmpty == false){
Row1.instanceManager.removeInstance(i);
}
}