def _get_all_styles(self):
        """
        return a dictionary of {(row, col) -> CellStyle}
        for all cells that use a non-default style.
        """
        _styles = {}
        def _get_style(bold=False, bg_col=None, border=None):
            if (bold, bg_col, border) not in _styles:
                _styles[(bold, bg_col, border)] = CellStyle(bold=bold,
                                                            bg_color=bg_col,
                                                            border=border)
            return _styles[(bold, bg_col, border)]

        ws_styles = {}
        for table, (row, col) in self.__tables.values():
            for r in range(row, row + table.header_height):
                for c in range(col, col + table.width):
                    if isinstance(table.header_style, dict):
                        col_name = table.dataframe.columns[c - col]
                        style = table.header_style.get(col_name, _get_style(bold=True))
                    else:
                        style = table.header_style or _get_style(bold=True)
                    ws_styles[(r, c)] = style

            for c in range(col, col + table.row_labels_width):
                for r in range(row + table.header_height, row + table.height):
                    if isinstance(table.index_style, dict):
                        row_name = table.dataframe.index[r - row]
                        style = table.index_style.get(row_name, _get_style(bold=True))
                    else:
                        style = table.index_style or _get_style(bold=True)
                    ws_styles[(r, c)] = style

            if table.style.stripe_colors or table.style.border:
                num_bg_cols = len(table.style.stripe_colors) if \
                    table.style.stripe_colors else 1
                bg_cols = table.style.stripe_colors if \
                    table.style.stripe_colors else None

                for i, row_offset in enumerate(range(table.header_height,
                                                     table.height)):
                    for c in range(col, col + table.width):
                        bg_col = bg_cols[i % num_bg_cols] if bg_cols else None
                        style = _get_style(bold=None, bg_col=bg_col, border=table.style.border)
                        if (row + row_offset, c) in ws_styles:
                            style = style + ws_styles[(row + row_offset, c)]
                        ws_styles[(row + row_offset, c)] = style

            for col_name, col_style in table.column_styles.items():
                try:
                    col_offset = table.get_column_offset(col_name)
                except KeyError:
                    continue
                for i, r in enumerate(range(row + table.header_height, row + table.height)):
                    style = col_style
                    if (r, col + col_offset) in ws_styles:
                        style = ws_styles[(r, col + col_offset)] + style
                    ws_styles[(r, col + col_offset)] = style

            for row_name, row_style in table.row_styles.items():
                try:
                    row_offset = table.get_row_offset(row_name)
                except KeyError:
                    continue
                for i, c in enumerate(range(col + table.row_labels_width, col + table.width)):
                    style = row_style
                    if (row + row_offset, c) in ws_styles:
                        style = ws_styles[(row + row_offset, c)] + style
                    ws_styles[(row + row_offset, c)] = style

            for (row_name, col_name), cell_style in table.cell_styles.items():
                try:
                    col_offset = table.get_column_offset(col_name)
                    row_offset = table.get_row_offset(row_name)
                except KeyError:
                    continue
                style = cell_style
                if (row + row_offset, col + col_offset) in ws_styles:
                    style = ws_styles[(row + row_offset, col + col_offset)] + style
                ws_styles[(row + row_offset, col + col_offset)] = style

        for (row, col), value in self.__values.items():
            if isinstance(value, Value):
                style = value.style
                if style:
                    if (row, col) in ws_styles:
                        style = style + ws_styles[(row, col)]
                    ws_styles[(row, col)] = style

        return ws_styles