def _render_content(self, content, **settings):
        """
        Perform widget rendering, but do not print anything.
        """
        result = []
        columns = settings[self.SETTING_COLUMNS]

        # Format each table cell into string.
        (columns, content) = self.table_format(columns, content)

        # Enumerate each table row.
        if settings[self.SETTING_FLAG_ENUMERATE]:
            (columns, content) = self.table_enumerate(columns, content)

        # Calculate the dimensions of each table column.
        dimensions = self.table_measure(columns, content)

        # Display table header.
        sb = {k: settings[k] for k in (self.SETTING_BORDER_STYLE, self.SETTING_BORDER_FORMATING)}
        result.append(self.fmt_border(dimensions, 't', **sb))
        if settings[self.SETTING_FLAG_HEADER]:
            s = {k: settings[k] for k in (self.SETTING_FLAG_PLAIN, self.SETTING_BORDER_STYLE, self.SETTING_BORDER_FORMATING)}
            s[self.SETTING_TEXT_FORMATING] = settings[self.SETTING_HEADER_FORMATING]
            result.append(self.fmt_row_header(columns, dimensions, **s))
            result.append(self.fmt_border(dimensions, 'm', **sb))

        # Display table body.
        for row in content:
            s = {k: settings[k] for k in (self.SETTING_FLAG_PLAIN, self.SETTING_BORDER_STYLE, self.SETTING_BORDER_FORMATING)}
            s[self.SETTING_TEXT_FORMATING] = settings[self.SETTING_TEXT_FORMATING]
            result.append(self.fmt_row(columns, dimensions, row, **s))

        # Display table footer
        result.append(self.fmt_border(dimensions, 'b', **sb))
        return result
def _render_content ( self , content , ** settings ) : result = [ ] columns = settings [ self . SETTING_COLUMNS ] ( columns , content ) = self . table_format ( columns , content ) if settings [ self . SETTING_FLAG_ENUMERATE ] : ( columns , content ) = self . table_enumerate ( columns , content ) dimensions = self . table_measure ( columns , content ) sb = { k : settings [ k ] for k in ( self . SETTING_BORDER_STYLE , self . SETTING_BORDER_FORMATING ) } result . append ( self . fmt_border ( dimensions , 't' , ** sb ) ) if settings [ self . SETTING_FLAG_HEADER ] : s = { k : settings [ k ] for k in ( self . SETTING_FLAG_PLAIN , self . SETTING_BORDER_STYLE , self . SETTING_BORDER_FORMATING ) } s [ self . SETTING_TEXT_FORMATING ] = settings [ self . SETTING_HEADER_FORMATING ] result . append ( self . fmt_row_header ( columns , dimensions , ** s ) ) result . append ( self . fmt_border ( dimensions , 'm' , ** sb ) ) for row in content : s = { k : settings [ k ] for k in ( self . SETTING_FLAG_PLAIN , self . SETTING_BORDER_STYLE , self . SETTING_BORDER_FORMATING ) } s [ self . SETTING_TEXT_FORMATING ] = settings [ self . SETTING_TEXT_FORMATING ] result . append ( self . fmt_row ( columns , dimensions , row , ** s ) ) result . append ( self . fmt_border ( dimensions , 'b' , ** sb ) ) return result
Perform widget rendering, but do not print anything.