MediaWiki:Gadget-OutsideTable.js:修订间差异
跳转到导航
跳转到搜索
(// Edit via Wikiplus) |
(没有差异)
|
2023年1月28日 (六) 20:52的版本
function injectDivOutsideTable() { //注入表格外父级div
var allTable = document.getElementsByTagName("table");
if(allTable) {
for(var child_ in allTable) {
var child = allTable[child_];
var divOutside = document.createElement('div');
divOutside.setAttribute("class", "divOutsideTable");
if(child.parentNode){
child.parentNode.insertBefore(divOutside, child);
divOutside.appendChild(child);
}
}
return true;
} else {
return false;
}
}
$(function() {
injectDivOutsideTable();
});