def __repr__(self):
        "Creates a complete representation of the table."
        buffer = [list(map(repr, ['ROW_ID'] + [name for index, name, data_type \
                                               in self.__columns]))]
        width = [0] * len(buffer[0])
        for row in sorted(self.__data_area):
            buffer.append(list(map(repr, [row] + [self.__data_area[row][index] \
                                                  for index, name, data_type \
                                                  in self.__columns])))
        for row in buffer:
            for index, string in enumerate(row):
                width[index] = max(width[index], len(string))
        string = ''
        for index, value in enumerate(buffer[0]):
            string += value.ljust(width[index]) + ' | '
        string = string[:-3] + '\n'
        for index in range(len(buffer[0])):
            string += '-' * width[index] + '-+-'
        string = string[:-3] + '\n'
        for row in buffer[1:]:
            for index, value in enumerate(row):
                string += value.ljust(width[index]) + ' | '
            string = string[:-3] + '\n'
        return string[:-1]
Creates a complete representation of the table.
recipes/Python/577825_Rudimentary_Database_Engine/recipe-577825.py