if("#{javascript:document1.isEditable()}" == "false"){ dojo.query('table td table[id]').forEach(function(node) { var value = ''; // Get the value out of all cells in the nested table and concatenate them dojo.query('td', node).forEach(function(innerNode) { value += innerNode.innerHTML + ', '; }); // Replace the table with only the value(s) (or a blank), but cut off the trailing comma node.outerHTML = value.substring(0, value.length-2); }); }