如何将td标签替换为表中的th [英] how to replace td tags to th in table

查看:445
本文介绍了如何将td标签替换为表中的th的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有



i想要将我的桌子单元替换为桌头单元格



任何帮助。 ..

hi to all

i want to replace my table cells to tableheader cells

any help...

推荐答案





试试这个:

Hi,

Try this:
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.


这篇关于如何将td标签替换为表中的th的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆