Building Table in DOCX with N number of ROW'S

Certified Associate Developer

I need to create a dynamic DOCX document that includes a table with 11 columns, where each column should automatically adjusts its width.

I have attached a code snippet that generates a DOCX document with a table showing only 8 columns. The remaining 3 columns exceed the page width, so they aren't visible.

Please help me to fix it.

 

<div style='overflow-x: auto; margin-top: 10px;'>
<table class='table-solid-border' style='table-layout: auto;'>
<thead>
<tr>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>SAP Number</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Part Number</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Description</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Manufacturer</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Group</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Spare</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Qty</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Delivery Date</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Price</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Total</th>
<th class='table-solid-border budget-profile-table-header' style='text-align: center !important;'>Remarks</th>
</tr>
</thead>
<tbody style='background-color: ghostwhite;'>",
            a!forEach(
              items: local!selectedEquipments,
              expression: concat(
                "<tr>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & fv!item.sapnumber & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & fv!item.partnumber & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & fv!item.description & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & if(
                  a!isNotNullOrEmpty(fv!item.manufacturer),
                  fv!item.manufacturer,
                  "--"
                ) & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & fv!item.group & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & if(fv!item.spare, "Yes", "No") & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & fv!item.qty & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & text(
                  todate(fv!item.deliverydate),
                  "yyyy/mm/dd"
                ) & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & a!currency(isoCode: "USD", value: fv!item.cadprice) & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & a!currency(isoCode: "USD", value: fv!item.pricetotal) & "</td>",
                "<td class='budget-profile-table-column-value table-solid-border' style='text-align: center;'>" & if(
                  a!isNotNullOrEmpty(fv!item.remarks),
                  fv!item.remarks,
                  "--"
                ) & "</td>",
                "</tr>"
              )
            ),
            "</tbody></table></div>
<br></br>",
            
          )
        )
      )
    ),
    "</div>",

  Discussion posts and replies are publicly visible