JSFiddle - React, Tailwind, and code Playground

HTML

<table style="width:100%;" id="summarytable">
    <tr class="sLot">
        <td>Lot1</td>
    </tr>
    <tr class="sLineitem">
        <td>Lineitem1</td>
    </tr>
    <tr class="sLot">
        <td>Lot2</td>
    </tr>
</table>

JavaScript

$('tr').prepend($('<td />', {class: 'srno'}));

$('.sLot').each(function(i, el){
    var index = i + 1;
   	$(el).find('.srno').text(index);
    $(el).nextUntil('.sLot').filter('.sLineitem').each(function(j, el2){
    	$(el2).find('.srno').text(index + '.' + (j + 1));
    });
});