📄 win_table.asp
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>插入表格</title>
<link rel="stylesheet" href="html_edit.css" type="text/css">
<script>
var bordercolor="#000000";
var bgcolor="#FFFFFF";
var color="#000000";
function conjunction()
{
var arr = new Array();
rows = tablefrm.rows.value;
cols = tablefrm.cols.value;
attrs = "border=" + tablefrm.border.value + " bordercolor=" + bordercolor + " bgcolor=" + bgcolor + " cellpadding=2 cellspacing=0 width=98% style='border-collapse: collapse;color:" + color + "'";
window.dialogArguments.insertTable(rows,cols,attrs);
self.close();
}
function updateStyle()
{
tbl.setAttribute("border",tablefrm.border.value);
tbl.style.borderColor = bordercolor;
tbl.style.backgroundColor = bgcolor;
tbl.style.color = color;
}
function SelectColor(i)
{
var c=window.showModalDialog("win_select_color.asp","s","dialogWidth=300px;dialogHeight=270px;status=0");
if (c && c!="")
{
switch(i)
{
case 0:
window.document.all.item("bordercolor").bgColor=c;
bordercolor=c;
updateStyle();
break;
case 1:
window.document.all.item("bgcolor").bgColor=c;
bgcolor=c;
updateStyle();
break;
case 2:
window.document.all.item("color").bgColor=c;
color=c;
updateStyle();
break;
}
}
}
function is_int()
{
return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script>
</head>
<body onliad="updateStyle();" bgcolor="menu" style="border:0;overflow:hidden;">
<table border=0><tr><td height=3></td></tr></table>
<table border=0 width="100%">
<form name="tablefrm">
<tr><td align=center>
<fieldset style="padding-bottom:5px"><legend disabled>插入表格</legend>
<table cellpadding="1" cellspacing="3" border="0" width="96%">
<tr>
<td width="50%">
<table border=0 cellpadding=1 cellspacing=3>
<tr><td>表格行数:<input type="text" name="rows" size="4" value="3" onKeyPress="event.returnValue=is_int();"></td></tr>
<tr><td>表格列数:<input type="text" name="cols" size="4" value="3" onKeyPress="event.returnValue=is_int();"></td></tr>
<tr><td>表格边框:<select name="border" style="width:40;font-weight:bold;" onchange="updateStyle()">
<option value="0">0</option>
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td></tr>
</table>
<table border=0 cellpadding=1 cellspacing=3>
<tr>
<td>边框颜色:</td>
<td>
<table id="bordercolor" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" >
<tr>
<td width="100%" onClick="SelectColor(0);"><img border="0" src="images/clrbox.gif" width="16" height="16"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>背景颜色:</td>
<td>
<table id="bgcolor" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" >
<tr>
<td width="100%" onClick="SelectColor(1);"><img border="0" src="images/clrbox.gif" width="16" height="16"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>文本颜色:</td>
<td>
<table id="color" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" >
<tr>
<td width="100%" onClick="SelectColor(2);"><img border="0" src="images/clrbox.gif" width="16" height="16"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="50%" align=center>
<table style="border-collapse: collapse;" cellpadding="2" cellspacing="0" width="80%" height="80%" id="tbl" border="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<td align="center">表格预览</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
<table width="98%" border=0 cellpadding=0 cellspacing=0 height="35">
<tr><td align="right"><input name="B2" type="button" value=" 确定 " style="width:64px;" onClick="conjunction();"> <input type="button" name="B2" value=" 取消 " onclick="window.close();"></td></tr>
</table>
</td></tr>
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -