How to check if a table has rows or not

Hello,
I wrote a s=mall code to fetch data from my hubdb table and display it in my emails.
I would like to add a condition, that if my table has no rows in it(empty), a new section should appear. Thanks !
My snippet :

{% for row in hubdb_table_rows(5294922) %}

<tr><td><table role=“presentation” width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>

<tr>

<td width=“20”>\ </td>

<td style=“padding:10px; background-color:#f2f2f2;”>

<table role=“presentation” width=“100%” border=“0” cellspacing=“0” cellpadding=“0”>

<tr>

<th class=“stack-column-center” width=“120” align=“center” style="font-family: ‘Segoe UI’, Arial; color:#000000; font-size:15px; ">

<p style=“font-family: ‘Segoe UI’, Arial; color:#000000; font-size:15px; padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;”>{{ row.name }}</p>

</th>

<th class=“stack-column-center” align=“center” style=“font-family: ‘Segoe UI’, Arial; color:#000000; font-size:15px;” >

<p style=“font-family: ‘Segoe UI’, Arial; color:#000000; font-size:15px; padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;”><font style=“font-size:11px;”>Updated on :</font> {{ row.LastUpdated }}</p>

</th>

</tr></table> </td>

<td width=“20”>\ </td>

</tr>

</table></td></tr>

<tr>

<td height=“20” align=“right”>\ </td>

</tr>

{% endfor %}

Hi @ChrisChiha ,

Try the following by using the |length filter:

{% set rows = hubdb_table_rows(5294922) %}

{% if rows|length %}
{% for row in rows %}

<tr><td><table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td width="20"> </td>
<td style="padding:10px; background-color:#f2f2f2;">
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
 <th class="stack-column-center" width="120" align="center" style="font-family: 'Segoe UI', Arial; color:#000000; font-size:15px; ">
 <p style="font-family: 'Segoe UI', Arial; color:#000000; font-size:15px; padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;">{{ row.name }}</p>
 </th>

 <th class="stack-column-center" align="center" style="font-family: 'Segoe UI', Arial; color:#000000; font-size:15px;" >
 <p style="font-family: 'Segoe UI', Arial; color:#000000; font-size:15px; padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;"><font style="font-size:11px;">Updated on :</font> {{ row.LastUpdated }}</p>
 </th>
</tr></table> </td>
 <td width="20"> </td>
</tr>
</table></td></tr>
<tr>
 <td height="20" align="right"> </td>
 </tr>
{% endfor %}
{% else %}
// Your new section here
{% endif %}