how to calculate a total based on type

how to calculate a total based on type

Hi everyone 

    I have a html table that the rows are added dynamically and there is a column Type where the user inputs the following values from a drop down combo box :

Ncc
Regular
code

what I would like to do get the sum for every type for ex. the sum of Regular the sum of Ncc I  been on this for days and cannot figure out  how to do this below is a picture of the table