def _process_table_cells(self, table):
        """ Compile all the table cells.

        Returns a list of rows. The rows may have different lengths because of
        column spans.

        """

        rows = []

        for i, tr in enumerate(table.find_all('tr')):
            row = []

            for c in tr.contents:
                cell_type = getattr(c, 'name', None)

                if cell_type not in ('td', 'th'):
                    continue

                rowspan = int(c.attrs.get('rowspan', 1))
                colspan = int(c.attrs.get('colspan', 1))
                contents = self._process_children(c).strip()

                if cell_type == 'th' and i > 0:
                    contents = self._inline('**', contents)

                row.append(Cell(cell_type, rowspan, colspan, contents))

            rows.append(row)

        return rows
def _process_table_cells ( self , table ) : rows = [ ] for i , tr in enumerate ( table . find_all ( 'tr' ) ) : row = [ ] for c in tr . contents : cell_type = getattr ( c , 'name' , None ) if cell_type not in ( 'td' , 'th' ) : continue rowspan = int ( c . attrs . get ( 'rowspan' , 1 ) ) colspan = int ( c . attrs . get ( 'colspan' , 1 ) ) contents = self . _process_children ( c ) . strip ( ) if cell_type == 'th' and i > 0 : contents = self . _inline ( '**' , contents ) row . append ( Cell ( cell_type , rowspan , colspan , contents ) ) rows . append ( row ) return rows
Compile all the table cells.

        Returns a list of rows. The rows may have different lengths because of
        column spans.