一个可编辑的html表格
源代码在线查看: editor.htm
VML editor window.moveTo(0,0); window.resizeTo(screen.availWidth, screen.availHeight); function maak_code() { var raam = window.open('','vmlcode','height=600,width=600'); raam.document.open(); with(raam.document){ write('\n'); write('\nVML code\n\n'); write('\n'); write('\n\n'); write('\n'); write('\n\n\n'); write('\n'); write('\nv\\:* { behavior: url(#default#VML);}\n\n\n'); write('\n\n\n'); write(document.frames[0].document.body.innerHTML.replace(//gi, '\n')); write('\n\n\n\n'); write('\n\n'); write('\n'); write('\n\n'); write('\n'); write(''); } raam.document.close(); raam.focus(); } function legen() { document.frames[0].document.body.innerHTML = ''; document.frames[0].teller = 0; } kleurenkiezer = ''; function activeer_kiescellen() { var cellen = document.getElementsByTagName('td'); for(var i = 0; i < cellen.length; i++){ if(cellen[i].className == 'kleur'){ cellen[i].onclick = kies_kleur; } } } function voorbereiden_kleurkeuze(vul_of_rand) { if(kleurenkiezer != ''){ return;} document.getElementById(vul_of_rand + '_cel').style.backgroundColor = '#FFFFFF'; document.getElementById(vul_of_rand + '_cel').innerHTML = '选择颜色'; kleurenkiezer = vul_of_rand; } function kies_kleur() { if(kleurenkiezer == ''){ var fout = '你必须选择填充或者描边.\n\n'; fout += '你必须先单击"填充"或者"描边"上面的矩形颜色框 .\n\n'; fout += '然后你可以冲调色板中选择颜色. '; fout += '如果你不想要填充色或者描边色, 可以单击 X.\n'; alert(fout); return; } var kleur = (this.childNodes.length > 0)? '': this.bgColor; var HTML = (this.childNodes.length > 0)? '透明': ''; document.forms[0].elements[kleurenkiezer].value = kleur; document.getElementById(kleurenkiezer + '_cel').innerHTML = HTML; document.getElementById(kleurenkiezer + '_cel').style.backgroundColor = this.bgColor; kleurenkiezer = ''; } function verwijder_vorm_uit_tekenblad() { if(document.frames[0].teller > 0){ document.frames[0].document.getElementById('nr' + document.frames[0].teller).removeNode(true); document.frames[0].document.getElementsByTagName('br')[(document.frames[0].teller - 1)].removeNode(true); document.frames[0].teller--; } } window.onerror = function(){ return true;} window.onload = activeer_kiescellen; document.writeln(''); document.writeln(''); document.writeln('v\\:* { behavior: url(#default#VML);}'); document.writeln(''); body { background-color: buttonface; } select, input, td { font-family: Verdana, Arial; font-size: 10px; } .kleur { width: 20px; height: 20px; cursor: hand; } hr { width: 150px; } 工具形状: 任意形状 椭圆 矩形 圆角矩形 大小: 1px 2px 3px 4px 5px 6px 7px 8px 9px 10px 11px 12px X 透明 填充 描边 消除锯齿 This application uses JavaScript. Enable JavaScript if you want to use this application. document.getElementById('geen_script').innerText = ''; document.forms[0].reset(); document.writeln(''); This page can only be viewed in Internet Explorer 5+ (Windows).