docx2html/core.py
def build_table(table, meta_data):
    """
    This returns a table object with all rows and cells correctly populated.
    """

    # Create a blank table element.
    table_el = etree.Element('table')
    w_namespace = get_namespace(table, 'w')

    # Get the rowspan values for cells that have a rowspan.
    row_spans = get_rowspan_data(table)
    for el in table:
        if el.tag == '%str' % w_namespace:
            # Create the tr element.
            tr_el = build_tr(
                el,
                meta_data,
                row_spans,
            )
            # And append it to the table.
            table_el.append(tr_el)

    visited_nodes = list(table.iter())
    return table_el, visited_nodes
def build_table(table, meta_data):
    # Create a blank table element.
    table_el = etree.Element('table')
    w_namespace = get_namespace(table, 'w')

    # Get the rowspan values for cells that have a rowspan.
    row_spans = get_rowspan_data(table)
    for el in table:
        if el.tag == '%str' % w_namespace:
            # Create the tr element.
            tr_el = build_tr(
                el,
                meta_data,
                row_spans,
            )
            # And append it to the table.
            table_el.append(tr_el)

    visited_nodes = list(table.iter())
    return table_el, visited_nodes
def build_table ( table , meta_data ) : # Create a blank table element. table_el = etree . Element ( 'table' ) w_namespace = get_namespace ( table , 'w' ) # Get the rowspan values for cells that have a rowspan. row_spans = get_rowspan_data ( table ) for el in table : if el . tag == '%str' % w_namespace : # Create the tr element. tr_el = build_tr ( el , meta_data , row_spans , ) # And append it to the table. table_el . append ( tr_el ) visited_nodes = list ( table . iter ( ) ) return table_el , visited_nodes
This returns a table object with all rows and cells correctly populated.
This returns a table object with all rows and cells correctly populated .