In this example, we first get the reference of the table using the function call
var table = document.getElementById('productlist');
Then loop through each row of the table.
Each time data read from a cell is added to a string separated by a delimiter ( here we used "," ).
Finally the data read is displayed by using alert() function.
Entire code of this example is given below: