def collect_table_content(table_bboxes, elems):
<EOL>table_contents = [[] for _ in range(len(table_bboxes))]<EOL>prev_content = None<EOL>prev_bbox = None<EOL>for cid, c in enumerate(elems):<EOL><INDENT>if isinstance(c, LTAnno):<EOL><INDENT>if prev_content is not None:<EOL><INDENT>prev_content.append(c)<EOL><DEDENT>continue<EOL><DEDENT>if prev_bbox is not None and intersect(prev_bbox, c.bbox):<EOL><INDENT>prev_content.append(c)<EOL>continue<EOL><DEDENT>for table_id, table_bbox in enumerate(table_bboxes):<EOL><INDENT>if intersect(table_bbox, c.bbox):<EOL><INDENT>prev_bbox = table_bbox<EOL>prev_content = table_contents[table_id]<EOL>prev_content.append(c)<EOL>break<EOL><DEDENT><DEDENT><DEDENT>return table_contents<EOL>
Returns a list of elements that are contained inside
the corresponding supplied bbox.