How to check last record in table in Angular
P粉668146636
2023-08-14 14:05:14
<p>I have this table row</p>
<pre class="brush:php;toolbar:false;"><tbody>
<tr *ngFor="let data of List | paginate : { itemsPerPage: 10, currentPage: p };
let i = index">
<td>{{ data.Name }}</td>
<td>
</td>
...
</tr>
</tbody></pre>
<p>I want to check the last record of each page. Suppose there are 12 records, and each page has <code>10</code>, then another page has <code>2</code> strips, I want to check the last record of each page and apply CSS style on the last record of each page. </p>
<p>Is there any solution? Thank you</p>
You have two choices.
Option 1: Conditionally apply a class using ngClass
Option 2: Select the last tr
in your stylesheet