For create table dynamically use can use following method:
- Create one label in your popup window i.e. lblData
- On your button click write following code:
var sTableData = '';
var iRow = 0;
sTableData = '<table>';
for(iRow=0;iRow<=tablerowcount;iRow++)
{
sTableData = sTableData + '<tr><td>specify data you want show</td</tr>';
}
sTableData = sTableData + '</table>;
document.getElementById('lblData').innerHTML = sTableData;
Hope it will be helpful.