Making datatable short

Hi Team,

My Input:
image

I want my output as below:
image

Clubbing them near to 100 rows but sometimes the ending index remains 401 or 402 then we will have to keep it to 401 depending on the ending index present.

@yash.choursia

Can you please explain the relation

cheers