الشبكة
代码如下:
<style>
مدخل
{
defineInputOnClick: expression (this.onclick = function () {if (this.type == "button") {this.style.color = choosecolor () ؛}}) ؛
}
</style>
<script>
var igridRowCount = 0 ؛
var igridColcount = 0 ؛
وظيفة creategrid ()
{
divid.innerhtml = "" ؛
if (igridRowCount == 0) {igridRowCount = 5 ؛}
if (igridColcount == 0) {igridColcount = 5 ؛}
var vtable = document.createElement ("table") ؛
vtable.style.behavior = "url (grid.htc)" ؛
إذا (defineGridBgColorid.style.color)
{vtable.definegridbgcolor = defineGridBgColorId.style.color ؛}
if (defineFirstrowBgColorid.style.color)
{vtable.defineFirstrowBgColor = defineFirstrowBgColorid.style.color ؛}
if (defineFirstColbgColorid.style.color)
{vtable.defineFirstColbgColor = defineFirstColbgColorid.style.color ؛}
if (interecurrowbgcolorid.style.color)
ack
if (interecurcolbgcolorid.style.color)
ack
if (interecureditbgcolorid.style.color)
{vtable.definecureditbgcolor = inquireditbgcolorid.style.color ؛}
لـ (mindex = 0 ؛ mindex <igridRowCount ؛ Mindex ++)
{
var vtr = vtable.inserTrow (mindex) ؛
لـ (nindex = 0 ؛ nindex <igridcolcount ؛ nindex ++)
{
vtd = vtr.insertcell (nindex) ؛
vtd.innertext = "行"+mindex+"列"+nindex ؛
}
}
Divid.AppendChild (vtable) ؛
}
وظيفة choosecolor ()
{
var strcolor = dlghelper.choosecolordlg () ؛
strcolor = strcolor.toString (16) ؛
إذا (strcolor.length <6)
{
var stempstring = "000000" .SubString (0،6-strcolor.length) ؛
strcolor = stempstring.concat (strcolor) ؛
}
إرجاع strcolor.
}
</script>
<div id = "divid"> </viv>
<object id = "dlghelper" classid = "clsid: 3050f819-98b5-11CF-BB82-00AA00BDCE0B"> </bount>
<fieldset>
<button onClick = "window.confirm ('已实现功能')"> Grid 参数区 </butting> <br>
<type type = button value = "表格背景" id = "defineGridBgColorId"> <br>
<type type = button value = "头行背景" id = "defineFirstrowBgColorId"> <br>
<type type = button value = "头列背景" id = "defineFirstColbgColorId"> <br>
<type type = button value = "当前选择行背景" id = "defereCurrowBgColorId"> <br>
<type type = button value = "当前选择列背景" id = "defedecurcolbgColorId"> <br>
<type type = button value = "当前选择编辑单元格背景" id = "equireditbgColorId"> <br>
<button onClick = "window.confirm ('未实现功能')"> 保留功能区 </butting> <br>
<type type = text value = "" id = "defineGridRowCount"> <button onClick = "iGridRowCount = defineGridRowCount.value ؛"> 行数 </butting> <br>
<type type = text value = "" id = "defineGridColcount"> <buttin onClick = "iGridColcount = defineGridColcount.value ؛"> 列数 </butting> <br>
<نوع الإدخال = الراديو> 是 <نوع الإدخال = الراديو> 否启动行调整 <br>