Click here to Skip to main content
16,018,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi to all

i want to replace my table cells to tableheader cells

any help...
Posted
Updated 13-Dec-12 23:16pm
v2
Comments
[no name] 14-Dec-12 5:17am    
why are you doin this ??
[no name] 14-Dec-12 5:32am    
Its a blind assumption but try to make one method, which will replace <th> with <td> or vice versa...
-Krunal R.

1 solution

Hi,

Try this:
JavaScript
var str = document.body.innerHTML;
var newStr0 = str.split("<td").join("<th"); // replace <td with <th
var newStr1 = newStr0.split("</td>").join("</th>"); // replace  </td> with </th>
document.body.innerHTML = newStr1;

Hope this helps.
 
Share this answer
 
v2
Comments
VenuKalyan 14-Dec-12 5:57am    
thnq very much..its workng great..
Thomas Daniels 14-Dec-12 5:59am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900