'Ensure first two rows (column header and separator row) are valid table rows.
Keep border check and separator row do avoid repeating the work.'

def test(self, parent, block):

    is_table = False
    rows = [row.strip() for row in block.split(u'\n')]
    if (len(rows) > 1):
        header0 = rows[0]
        self.border = PIPE_NONE
        if header0.startswith(u'|'):
            self.border |= PIPE_LEFT
        if (self.RE_END_BORDER.search(header0) is not None):
            self.border |= PIPE_RIGHT
        row = self._split_row(header0)
        row0_len = len(row)
        is_table = (row0_len > 1)
        if ((not is_table) and (row0_len == 1) and self.border):
            for index in range(1, len(rows)):
                is_table = rows[index].startswith(u'|')
                if (not is_table):
                    is_table = (self.RE_END_BORDER.search(rows[index]) is not None)
                if (not is_table):
                    break
        if is_table:
            row = self._split_row(rows[1])
            is_table = ((len(row) == row0_len) and (set(u''.join(row)) <= set(u'|:-    ')))
            if is_table:
                self.separator = row
    return is_table
