EE’s layout variables are only ‘instantiated’ when the template processing is completed - so you cannot access them from within the same template that they are created within.
Separately there is an issue in your template layout - the ‘no results’ block needs to be within the Channel Entries
tag pair.
Two solutions:
If you went down the first path you would end up with something like this:
{exp:channel:entries channel='Administrator' paginate="bottom"}
{if no_results}
There are no registered administrators.
{/if}
{if count == 1}
<table class="table table-hover">
<thead>
<tr>
<th scope="col">First name</th>
<th scope="col">Last name</th>
<th scope="col">Username</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
{/if}
<tr>
<td>{admin_first_name}</td>
<td>test</td>
<td>test</td>
</tr>
{if count == total_results}
</tbody>
</table>
{/if}
{/exp:channel:entries}
HTH
🐾
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.