Item12735: the handling of the end-of-table in the ERP showed up some problems with the core table handling code. It works, but it wasn't as robust to pathological cases as I wanted. It is now.

git-svn-id: http://svn.foswiki.org/trunk/core@17433 0b4bb1d4-4e5a-0410-9cc4-b2b747904278