You want to count the rows as they are the repeating object, not the table. If you had repeating tables your code would work.
And for .length I think you might need to use resolveNodes() (I'm at home now, just going off the top of my head):
var oRows = xfa.resolveNodes("TableKM.Row1[*]");
var nLength = oRows.length;
You can also use the Instance Manager to count:
var nLength = TableKM._Row1.count;