@doubleunary The link to "row misalignment issue" is perfect; I should have known that this was a common problem; that post describes an excellent approach. (I'm going to explore a possible minor improvement: I know it's possible to get the row number of a given row, and I'm wondering if there's some way to use row numbers for what the post calls AIN, rather than adding an auxiliary column that's essentially exactly a row number. But this would be a cosmetic and aesthetic improvement, not a functional improvement.)
Many many thanks for the pointer.