mail.163.com顺便,我也把我自己做的一点简单的表格程序贡献出来,大家共享,也许有点用,大家讨论一下,看是否还有更好的办法:<TABLE BORDER="1" id=tbl style="border-collapse:collapse" cellspacing=0 cellpadding=0 borderColor='black'>
<COL STYLE="color:red" id=col1 >
<COL STYLE="color:blue" id=col2>
<COL STYLE="color:green" id=col3>
<TR onmouseover="this.style.backgroundColor='#cceedd'" onmouseout="this.style.backgroundColor=''">
<TD onclick="col1.style.color=(col1.style.color=='red')?'orange':'red'" onmouseover="this.style.cursor='hand'">此列位于第一组。</TD>
<TD onclick="col2.style.color=(col2.style.color=='blue')?'orange':'blue'" onmouseover="this.style.cursor='hand'">此列位于第二组。</TD>
<TD onclick="col3.style.color=(col3.style.color=='green')?'orange':'green'" onmouseover="this.style.cursor='hand'">此列位于第三组。</TD>
</TR>
<TR onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''">
<TD>此列位于第一组。</TD>
<TD>此列位于第二组。</TD>
<TD>此列位于第三组。</TD>
</TR>
<TR onmouseover="this.style.backgroundColor='#dddddd'" onmouseout="this.style.backgroundColor=''">
<TD>此列位于第一组。</TD>
<TD>此列位于第二组。</TD>
<TD>此列位于第三组。</TD>
</TR></TABLE>
<button onclick="alert(tbl.rows(0).cells(tbl.rows(0).cells.length-1).onclick);">test</button>
<button onclick="col1.width='150px'">test</button>
<button id="btn1">添加行</button><button id="btn2">添加列</button>
<SCRIPT LANGUAGE=javascript>
<!--
var A=new Array('cc0099','99cc00','cc9966','cccc00','99ff99','99ff66','ff3399','cc6699','ff33ff','cc99cc','ffcc66');function btn1.onclick(){
tbl.lastChild.appendChild(tbl.rows(tbl.rows.length-1).cloneNode(true));
}function btn2.onclick(){
var coln=tbl.firstChild.firstChild.cloneNode(true);
coln.id='col'+(document.getElementsByTagName("COL").length+1);
var t="#"+A[document.getElementsByTagName("COL").length-3]
coln.style.color=t;
tbl.firstChild.appendChild(coln);
var newID=eval('col'+(document.getElementsByTagName("COL").length));
for(i=0;i<tbl.rows.length;i++){
newCell=tbl.rows(i).cells(0).cloneNode(true);
newCell.innerText="这是新添加的列";
if(i==0)newCell.onclick=function(){newID.style.color=newID.style.color==t?'orange':t}
tbl.rows(i).appendChild(newCell);
}}//-->
</SCRIPT>
<COL STYLE="color:red" id=col1 >
<COL STYLE="color:blue" id=col2>
<COL STYLE="color:green" id=col3>
<TR onmouseover="this.style.backgroundColor='#cceedd'" onmouseout="this.style.backgroundColor=''">
<TD onclick="col1.style.color=(col1.style.color=='red')?'orange':'red'" onmouseover="this.style.cursor='hand'">此列位于第一组。</TD>
<TD onclick="col2.style.color=(col2.style.color=='blue')?'orange':'blue'" onmouseover="this.style.cursor='hand'">此列位于第二组。</TD>
<TD onclick="col3.style.color=(col3.style.color=='green')?'orange':'green'" onmouseover="this.style.cursor='hand'">此列位于第三组。</TD>
</TR>
<TR onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''">
<TD>此列位于第一组。</TD>
<TD>此列位于第二组。</TD>
<TD>此列位于第三组。</TD>
</TR>
<TR onmouseover="this.style.backgroundColor='#dddddd'" onmouseout="this.style.backgroundColor=''">
<TD>此列位于第一组。</TD>
<TD>此列位于第二组。</TD>
<TD>此列位于第三组。</TD>
</TR></TABLE>
<button onclick="alert(tbl.rows(0).cells(tbl.rows(0).cells.length-1).onclick);">test</button>
<button onclick="col1.width='150px'">test</button>
<button id="btn1">添加行</button><button id="btn2">添加列</button>
<SCRIPT LANGUAGE=javascript>
<!--
var A=new Array('cc0099','99cc00','cc9966','cccc00','99ff99','99ff66','ff3399','cc6699','ff33ff','cc99cc','ffcc66');function btn1.onclick(){
tbl.lastChild.appendChild(tbl.rows(tbl.rows.length-1).cloneNode(true));
}function btn2.onclick(){
var coln=tbl.firstChild.firstChild.cloneNode(true);
coln.id='col'+(document.getElementsByTagName("COL").length+1);
var t="#"+A[document.getElementsByTagName("COL").length-3]
coln.style.color=t;
tbl.firstChild.appendChild(coln);
var newID=eval('col'+(document.getElementsByTagName("COL").length));
for(i=0;i<tbl.rows.length;i++){
newCell=tbl.rows(i).cells(0).cloneNode(true);
newCell.innerText="这是新添加的列";
if(i==0)newCell.onclick=function(){newID.style.color=newID.style.color==t?'orange':t}
tbl.rows(i).appendChild(newCell);
}}//-->
</SCRIPT>
解决方案 »
- 【关于JQuery设计思想之 方法函数化是什么意思啊?在线等···】
- 请问有c#语言怎么编写加密小程序啊 ?能不能加付一个加密程序!谢谢!!
- 这个写法是什么意思
- jQuery调用$.ajax()方法返回数据问题,希望大虾帮忙看看--急
- 求助弹出窗口在框架下无效的问题
- 【easyui-datagrid】父页面不能直接取到子页面的datagrid
- 急!关闭页面的处理问题!请指教!
- 请教关于焦点问题
- html框间javascript值传递
- spring mvc接受ajax参数问题
- 按回车submit按钮就提交,请问怎样禁止?
- 各位看看,这样算不算是在倒分??http://www.csdn.net/expert/topic/787/787719.xml?temp=.2608911
[email protected]
我也要学习
[email protected]
[email protected]
[email protected]
谢谢!!
我的email:[email protected]
[email protected]
我用HTC做过客户端的dataset,dbEdit ,dbMemo ,dbGrid,combox,PageControl,PIE图,Calendar等。可以互相交流。
thanks!