Table parsing logic