Serial Number for dynamic table using jQuery

Serial Number for dynamic table using jQuery

I have a dynamic table which has 2 dynamic rows .i.e students and their subjects and marks. The code is below : 


Everything is working fine except, the serial numbers are not generated dynamically! Where could I have possibly gone wrong? Would appreciate any help/ suggestions! :)