'write styles combinations based on ids found in tables'

def _write_cell_styles(self):

    cell_xfs = SubElement(self._root, 'cellXfs', count=('%d' % len(self.wb._cell_styles)))
    for style in self.wb._cell_styles:
        node = style.to_tree()
        cell_xfs.append(node)
        if style.applyAlignment:
            al = self.wb._alignments[style.alignmentId]
            el = al.to_tree()
            node.append(el)
        if style.applyProtection:
            prot = self.wb._protections[style.protectionId]
            el = prot.to_tree()
            node.append(el)
