Fixes #2891: Re-factoring how selected rows is handled in the alch-table

directive.