For each request, we have an audit history that I'm displaying as tabular data with 2 rows per page. However, this creates an issue: if I show only 2 rows per page, the remaining space on the page looks empty. On the other hand, if I display 3 rows per

Certified Senior Developer

For each request, we have an audit history that I'm displaying as tabular data with 2 rows per page. However, this creates an issue: if I show only 2 rows per page, the remaining space on the page looks empty. On the other hand, if I display 3 rows per page, it doesn’t fit well if any row contains a large amount of data.
Below I have attached reference code for this:


Note:We have to display header and general info after page break
any Alternatives for this,

a!localVariables(
  local!requestAuditLog:rule!EPR_QE_V_getRequestAuditLog(requestId:ri!requestId,actionNotIn: cons!EPR_ACTION_LIST[1]),
  local!tableHeadings: {
    "Date",
    "User Name",
    "Action Taken",
    "Note"
  },
  
  "
<html>
<body>

<table id='notes'>
<thead>
"&if(a!isNullOrEmpty(local!requestAuditLog),"No Notes avaliable for this request",
"<tr style='background-color:#c0e4dc'>
<th colspan='4'><b>AR Notes</b></th>
</tr>
<tr style='background-color:#A1A0D3'>

<th>" & local!tableHeadings[1] & "</th>
<th>" & local!tableHeadings[2] & "</th>
<th>" & local!tableHeadings[3] & "</th>
<th>" & local!tableHeadings[4] & "</th>
</tr>
</thead>
<tbody>
"&a!localVariables(
  local!rows: 
    a!forEach(
    items: local!requestAuditLog,
    expression: "<tr style='height:auto;width:100%;font-size: 10px;padding:0'>
<td style='width:100px;padding:0'>" & text(index(fv!item,"createdDate",{}),"dd/mm/yyyy") & "</td>
<td style='width:100px;padding:0'>" & rule!EPR_DisplayFullUserName(
  index(fv!item,"createdBy",{})) & "</td>
<td style='width:100px;padding:0'>" & index(fv!item,"action",{}) & "</td>
<td style='width:auto;height:auto;'>" & index(fv!item,"comment",{}) & "</td>
</tr>"
  ),
  local!rowsWithPageBreaks: a!forEach(
    items: local!rows,
    expression: a!localVariables(
      fv!item & if(
        mod(fv!index, 2) <> 0, "", 
        if(fv!itemCount=fv!index,"",
        "</tbody></table><p class='page-break'></p>" & "<div style='page-break-before: always;'>
<div  class = 'header-rule'>
"& rule!EPR_HTMLTemplate_SectionHeader()& "
</div>
" & rule!EPR_CMPT_GeneralInformation(requestId: ri!requestId) & "
</div><table id = 'notes'><tbody>"
        ))
    )
  ),
  joinarray(local!rowsWithPageBreaks, "")
)
&"
</tbody>")&"
</table>
</body>
</html>"
)

  Discussion posts and replies are publicly visible