def dict_table(cls,
                   d,
                   order=None,
                   header=None,
                   sort_keys=True,
                   show_none="",
                   max_width=40):
        """prints a pretty table from an dict of dicts
        :param d: A a dict with dicts of the same type.
                      Each key will be a column
        :param order: The order in which the columns are printed.
                      The order is specified by the key names of the dict.
        :param header:  The Header of each of the columns
        :type header:   A list of string
        :param sort_keys:   Key(s) of the dict to be used for sorting.
                            This specify the column(s) in the table for sorting.
        :type sort_keys:    string or a tuple of string (for sorting with multiple columns)
        :param show_none: prints None if True for None values otherwise ""
        :type show_none: bool
        :param max_width: maximum width for a cell
        :type max_width: int
        """

        def _keys():
            all_keys = []
            for e in d:
                keys = d[e].keys()
                all_keys.extend(keys)
            return list(set(all_keys))

        # noinspection PyBroadException
        def _get(item, key):
            try:
                tmp = str(d[item][key])
                if tmp == "None":
                    tmp = show_none
            except:
                tmp = ' '
            return tmp

        if d is None or d == {}:
            return None

        if order is None:
            order = _keys()

        if header is None and order is not None:
            header = order
        elif header is None:
            header = _keys()

        x = PrettyTable(header)
        x.max_width = max_width

        if sort_keys:
            if type(sort_keys) is str:
                sorted_list = sorted(d, key=lambda x: d[x][sort_keys])
            elif type(sort_keys) == tuple:
                sorted_list = sorted(d, key=lambda x: tuple(
                    [d[x][sort_key] for sort_key in sort_keys]))
            else:
                sorted_list = d
        else:
            sorted_list = d

        for element in sorted_list:
            values = []
            for key in order:
                values.append(_get(element, key))
            x.add_row(values)
        x.align = "l"
        return x
prints a pretty table from an dict of dicts
        :param d: A a dict with dicts of the same type.
                      Each key will be a column
        :param order: The order in which the columns are printed.
                      The order is specified by the key names of the dict.
        :param header:  The Header of each of the columns
        :type header:   A list of string
        :param sort_keys:   Key(s) of the dict to be used for sorting.
                            This specify the column(s) in the table for sorting.
        :type sort_keys:    string or a tuple of string (for sorting with multiple columns)
        :param show_none: prints None if True for None values otherwise ""
        :type show_none: bool
        :param max_width: maximum width for a cell
        :type max_width: int