作者在 2008-01-11 16:23:35 发布以下内容
<HTML>
<HEAD>
<META. NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT. ID=clientEventHandlersJS LANGUAGE=JScript>
<!--
function document_oncontextmenu() {
window.event.returnValue = false;
return false;
}
//-->
</SCRIPT>
<SCRIPT. LANGUAGE=JScript. FOR=document EVENT=oncontextmenu>
<!--
document_oncontextmenu()
//-->
</SCRIPT>
</HEAD>
<LINK href="style.css" rel=stylesheet type=text/css>
<SCRIPT. LANGUAGE=JScript>
<!--
var NowW = 3;
var NowH = 3;
function MakeSerial(w,h)
{
return "" + w + "_" + h;
}
function MakeInputTable(MaxW,MaxH)
{
var Html = "<Table cellSpacing=1 cellPadding=1 border=0>";
for(var h =0;h<MaxH;h++)
{
Html += "<TR>";
for(var w = 0;w<MaxW;w++)
{
Html += "<TD>";
Html += "<INPUT type=\"text\" id=INPUT"+MakeSerial(w,h)+" name=INPUT"+MakeSerial(w,h)+" Size = 8 maxLength=32>";
Html += "</TD>";
}
Html += "</TR>";
}
Html += "</Table>";
return Html;
}
function MakeTable(MaxW,MaxH)
{
var Html = "<Table cellSpacing=0 cellPadding=1 border=1 borderColorDark=#FFFFFF borderColorLight=#000000 width=100% style=\"FONT-SIZE: medium; CURSOR: default; COLOR: aliceblue; BACKGROUND-COLOR: #556677\">";
for(var h =0;h<MaxH;h++)
{
Html += "<TR>";
for(var w = 0;w<MaxW;w++)
{
Html += "<TD>";
var Value = window.document.body.all("INPUT" + MakeSerial(w,h)).value;
if (Value=="")
Value = " ";
Html += Value;
Html += "</TD>";
}
Html += "</TR>";
}
Html += "</Table>";
return Html;
}
function AddW(Size)
{
NowW += Size;
if (NowW>12)
NowW = 12;
if (NowW<1)
NowW = 1;
INPUT.innerHTML = MakeInputTable(NowW,NowH);
}
function AddH(Size)
{
NowH += Size;
if (NowH>12)
NowH = 12;
if (NowH<1)
NowH = 1;
INPUT.innerHTML = MakeInputTable(NowW,NowH);
}
function Ok()
{
BASE.innerHTML = MakeTable(NowW,NowH);
}
//-->
</SCRIPT>
<BODY>
<TABLE cellSpacing=1 cellPadding=1 width="100%" border=0 Height="100%">
<TR Height="1%">
<TD></TD>
<TD align=middle><FONT face=黑体
size=5><STRONG>动态表格生成器</STRONG></FONT></TD>
<TD></TD>
</TR></TR>
<TR Height="50%">
<TD></TD>
<TD align=middle><DIV ID=BASE> </DIV></TD>
<TD></TD></TR>
<TR Height="49%">
<TD></TD>
<TD align=middle><DIV ID=INPUT></DIV></TD>
<TD></TD></TR>
<TR Height="1%">
<TD></TD>
<TD align=middle><INPUT type="button" value="增加行" nClick="AddH(1)"><INPUT type="button" value="减少行" nClick="AddH(-1)"> <INPUT type="button" value=" 提交 " nClick="Ok()"> <INPUT type="button" value="增加列" nClick="AddW(1)"><INPUT type="button" value="减少列" nClick="AddW(-1)"></TD>
<TD></TD>
</TR></TR>
</TABLE>
</BODY>
<SCRIPT. LANGUAGE=JScript>
<!--
INPUT.innerHTML = MakeInputTable(NowW,NowH);
//-->
</SCRIPT>
</HTML>
http://www.80diy.com/home/20060315/11/4615601.html
<HEAD>
<META. NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT. ID=clientEventHandlersJS LANGUAGE=JScript>
<!--
function document_oncontextmenu() {
window.event.returnValue = false;
return false;
}
//-->
</SCRIPT>
<SCRIPT. LANGUAGE=JScript. FOR=document EVENT=oncontextmenu>
<!--
document_oncontextmenu()
//-->
</SCRIPT>
</HEAD>
<LINK href="style.css" rel=stylesheet type=text/css>
<SCRIPT. LANGUAGE=JScript>
<!--
var NowW = 3;
var NowH = 3;
function MakeSerial(w,h)
{
return "" + w + "_" + h;
}
function MakeInputTable(MaxW,MaxH)
{
var Html = "<Table cellSpacing=1 cellPadding=1 border=0>";
for(var h =0;h<MaxH;h++)
{
Html += "<TR>";
for(var w = 0;w<MaxW;w++)
{
Html += "<TD>";
Html += "<INPUT type=\"text\" id=INPUT"+MakeSerial(w,h)+" name=INPUT"+MakeSerial(w,h)+" Size = 8 maxLength=32>";
Html += "</TD>";
}
Html += "</TR>";
}
Html += "</Table>";
return Html;
}
function MakeTable(MaxW,MaxH)
{
var Html = "<Table cellSpacing=0 cellPadding=1 border=1 borderColorDark=#FFFFFF borderColorLight=#000000 width=100% style=\"FONT-SIZE: medium; CURSOR: default; COLOR: aliceblue; BACKGROUND-COLOR: #556677\">";
for(var h =0;h<MaxH;h++)
{
Html += "<TR>";
for(var w = 0;w<MaxW;w++)
{
Html += "<TD>";
var Value = window.document.body.all("INPUT" + MakeSerial(w,h)).value;
if (Value=="")
Value = " ";
Html += Value;
Html += "</TD>";
}
Html += "</TR>";
}
Html += "</Table>";
return Html;
}
function AddW(Size)
{
NowW += Size;
if (NowW>12)
NowW = 12;
if (NowW<1)
NowW = 1;
INPUT.innerHTML = MakeInputTable(NowW,NowH);
}
function AddH(Size)
{
NowH += Size;
if (NowH>12)
NowH = 12;
if (NowH<1)
NowH = 1;
INPUT.innerHTML = MakeInputTable(NowW,NowH);
}
function Ok()
{
BASE.innerHTML = MakeTable(NowW,NowH);
}
//-->
</SCRIPT>
<BODY>
<TABLE cellSpacing=1 cellPadding=1 width="100%" border=0 Height="100%">
<TR Height="1%">
<TD></TD>
<TD align=middle><FONT face=黑体
size=5><STRONG>动态表格生成器</STRONG></FONT></TD>
<TD></TD>
</TR></TR>
<TR Height="50%">
<TD></TD>
<TD align=middle><DIV ID=BASE> </DIV></TD>
<TD></TD></TR>
<TR Height="49%">
<TD></TD>
<TD align=middle><DIV ID=INPUT></DIV></TD>
<TD></TD></TR>
<TR Height="1%">
<TD></TD>
<TD align=middle><INPUT type="button" value="增加行" nClick="AddH(1)"><INPUT type="button" value="减少行" nClick="AddH(-1)"> <INPUT type="button" value=" 提交 " nClick="Ok()"> <INPUT type="button" value="增加列" nClick="AddW(1)"><INPUT type="button" value="减少列" nClick="AddW(-1)"></TD>
<TD></TD>
</TR></TR>
</TABLE>
</BODY>
<SCRIPT. LANGUAGE=JScript>
<!--
INPUT.innerHTML = MakeInputTable(NowW,NowH);
//-->
</SCRIPT>
</HTML>
http://www.80diy.com/home/20060315/11/4615601.html