<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize(self):
 """Convert Table element to python dictionary."""

        data = {
            'type': self.__class__.__name__,
            'caption': self.caption.serialize(),
            'headings': [[cell.serialize() for cell in hrow] for hrow in self.headings],
            'rows': [[cell.serialize() for cell in row] for row in self.rows],
        }
        return data