Display the output as table.

    Args:

        * nested_indent: integer, specify the left alignment.
        * has_header: boolean specifying if header should be displayed. Default: True.
        * row_delimiter: character to separate rows. Default: ``_``.
        * delim: character to separate columns. Default: ``" | "``.
        * justify: text alignment. Default: ``center``.
        * separate_rows: boolean specifying if row separator will be displayed between consecutive rows. Default: True.
        * prefix: character at the beginning of the row. Default: ``"| "``.
        * suffix: character at the end of the row. Default: ``" |"``.
        * width: column max width. Default: ``50``.
        * rows_key: display the rows under a specific key.
        * labels_key: use the labels under a certain key. Otherwise will try to use the dictionary keys (if any).
        * title: display title when only one table is selected (using the ``rows_key`` argument).

def output(ret, **kwargs):
    '''
    Display the output as table.

    Args:

        * nested_indent: integer, specify the left alignment.
        * has_header: boolean specifying if header should be displayed. Default: True.
        * row_delimiter: character to separate rows. Default: ``_``.
        * delim: character to separate columns. Default: ``" | "``.
        * justify: text alignment. Default: ``center``.
        * separate_rows: boolean specifying if row separator will be displayed between consecutive rows. Default: True.
        * prefix: character at the beginning of the row. Default: ``"| "``.
        * suffix: character at the end of the row. Default: ``" |"``.
        * width: column max width. Default: ``50``.
        * rows_key: display the rows under a specific key.
        * labels_key: use the labels under a certain key. Otherwise will try to use the dictionary keys (if any).
        * title: display title when only one table is selected (using the ``rows_key`` argument).
    '''

    # to facilitate re-use
    if 'opts' in kwargs:
        global __opts__  # pylint: disable=W0601
        __opts__ = kwargs.pop('opts')

    # Prefer kwargs before opts
    base_indent = kwargs.get('nested_indent', 0) \
        or __opts__.get('out.table.nested_indent', 0)
    rows_key = kwargs.get('rows_key') \
        or __opts__.get('out.table.rows_key')
    labels_key = kwargs.get('labels_key') \
        or __opts__.get('out.table.labels_key')
    title = kwargs.get('title') \
        or __opts__.get('out.table.title')

    class_kvargs = {}
    argks = ('has_header', 'row_delimiter', 'delim', 'justify', 'separate_rows', 'prefix', 'suffix', 'width')

    for argk in argks:
        argv = kwargs.get(argk) \
            or __opts__.get('out.table.{key}'.format(key=argk))
        if argv is not None:
            class_kvargs[argk] = argv

    table = TableDisplay(**class_kvargs)

    out = []
    if title and rows_key:
        out.append(
            table.ustring(
                base_indent,
                title,
                table.WHITE,  # pylint: disable=no-member
                suffix='\n'
            )
        )

    return '\n'.join(table.display(salt.utils.data.decode(ret),
                                   base_indent,
                                   out,
                                   rows_key=rows_key,
                                   labels_key=labels_key))