improve speed of fetching table rows

also fix bug in getting inlineHeaderRows