'Parse a table.'

def table(self, isolate_function, parser_class):

    (block, messages, blank_finish) = isolate_function()
    if block:
        try:
            parser = parser_class()
            tabledata = parser.parse(block)
            tableline = ((self.state_machine.abs_line_number() - len(block)) + 1)
            table = self.build_table(tabledata, tableline)
            nodelist = ([table] + messages)
        except tableparser.TableMarkupError as detail:
            nodelist = (self.malformed_table(block, '    '.join(detail.args)) + messages)
    else:
        nodelist = messages
    return (nodelist, blank_finish)
