static bool FindVerticalCellSpacingBoxInsertionPoint(CssBox curRow, int cIndex, out CssBox insertAt) { int colcount = 0; int cellCount = curRow.ChildCount; var cnode = curRow.GetFirstChild(); int n = 0; while (cnode != null) { //all cell in this row if (colcount == cIndex) { //insert new spacing box for table //at 'colcount' index insertAt = cnode; return true;//found } else { colcount++; cIndex -= cnode.RowSpan - 1; } //---------- cnode = cnode.GetNextNode(); n++; } insertAt = null; return false; }