在php代码中嵌入基于javascript和html的构建表

Here i want to assign id for each tag but it is giving error to parse the single and double quotations as i want to build table using DOM methods trying to edit the row of the table which is clicked by the end user by clicking edit button of each row...
I tried in this way, but it is not accepting the table length..

var row = table.insertRow(table_len).outerHTML = '$itm_code$itm_desc$ord_qty$uom$locn';

When you refer to table_len while defining 'row', you should not escape the single quotes. For example, at the end of the HTML:

var row = '... onclick=\"Delete_Row(\'+table_len+\')\"></td></tr>';

Should be:

var row = '... onclick=\"Delete_Row('+table_len+')\"></td></tr>';