社区
JavaScript
帖子详情
请问table列互换的函数.在线等
chenfei00
2003-07-22 11:09:54
请问table列互换的函数.在线等
...全文
96
9
打赏
收藏
请问table列互换的函数.在线等
请问table列互换的函数.在线等
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
lsaturn
2003-07-23
打赏
举报
回复
我不是这么实现互换的,而是将列的文字交换来实现的!
seeu1688
2003-07-23
打赏
举报
回复
?这不是列交换吗
<TABLE ID="oTable" border=1>
<TR><TD style="background-color:red;color:white">Cell 1, Row 1</TD><TD>Cell 2, Row 1</TD><TD style="background-color:blue;color:white">Cell 3, Row 1</TD></TR>
<TR><TD style="background-color:red;color:white">Cell 1, Row 2</TD><TD>Cell 2, Row 2</TD><TD style="background-color:blue;color:white">Cell 3, Row 2</TD></TR>
<TR><TD style="background-color:red;color:white">Cell 1, Row 3</TD><TD>Cell 2, Row 3</TD><TD style="background-color:blue;color:white">Cell 3, Row 3</TD></TR>
<TR><TD style="background-color:red;color:white">Cell 1, Row 4</TD><TD>Cell 2, Row 4</TD><TD style="background-color:blue;color:white">Cell 3, Row 4</TD></TR>
</TABLE>
<INPUT TYPE="button" VALUE="第一列和第三列互换" onclick="swapTableCol(oTable, 0, 2)">
<SCRIPT LANGUAGE="JavaScript">
<!--
function swapTableCol(objTbl, col1, col2)
{
for (var i=0; i < objTbl.rows.length; i++)
{
objTbl.rows[i].cells[col1].swapNode(objTbl.rows[i].cells[col2])
}
}
//-->
</SCRIPT>
xiaoyuehen
2003-07-23
打赏
举报
回复
已有朋友解决此问题..
http://expert.csdn.net/Expert/TopicView1.asp?id=1670866
随风奔跑
2003-07-23
打赏
举报
回复
好像不行。列没有id的。
如果非要实现,可能很麻烦很麻烦。
chenfei00
2003-07-23
打赏
举报
回复
我要的是"列"互换..不是"行"互换..
seeu1688
2003-07-22
打赏
举报
回复
<TABLE ID="oTable" border=1>
<TR><TD style="background-color:red;color:white">Cell 1, Row 1</TD><TD>Cell 2, Row 1</TD><TD style="background-color:blue;color:white">Cell 3, Row 1</TD></TR>
<TR><TD style="background-color:red;color:white">Cell 1, Row 2</TD><TD>Cell 2, Row 2</TD><TD style="background-color:blue;color:white">Cell 3, Row 2</TD></TR>
<TR><TD style="background-color:red;color:white">Cell 1, Row 3</TD><TD>Cell 2, Row 3</TD><TD style="background-color:blue;color:white">Cell 3, Row 3</TD></TR>
<TR><TD style="background-color:red;color:white">Cell 1, Row 4</TD><TD>Cell 2, Row 4</TD><TD style="background-color:blue;color:white">Cell 3, Row 4</TD></TR>
</TABLE>
<INPUT TYPE="button" VALUE="第一列和第三列互换" onclick="swapTableCol(oTable, 0, 2)">
<SCRIPT LANGUAGE="JavaScript">
<!--
function swapTableCol(objTbl, col1, col2)
{
for (var i=0; i < objTbl.rows.length; i++)
{
objTbl.rows[i].cells[col1].swapNode(objTbl.rows[i].cells[col2])
}
}
//-->
</SCRIPT>
seeu1688
2003-07-22
打赏
举报
回复
<TABLE ID="oTable">
<TR><TD>Cell 1, Row 1</TD></TR>
<TR><TD>Cell 1, Row 2</TD></TR>
<TR><TD>Cell 1, Row 3</TD></TR>
<TR><TD>Cell 1, Row 4</TD></TR>
</TABLE>
<INPUT TYPE="button" VALUE="第二行和第四行互换" onclick="oTable.rows(1).swapNode(oTable.rows(3))">
seeu1688
2003-07-22
打赏
举报
回复
<TABLE ID="oTable">
<TR><TD>Cell 1, Row 1</TD></TR>
<TR><TD>Cell 1, Row 2</TD></TR>
<TR><TD>Cell 1, Row 3</TD></TR>
<TR><TD>Cell 1, Row 4</TD></TR>
</TABLE>
<INPUT TYPE="button" VALUE="Change Rows" onclick="oTable.moveRow(1,2)">
kingdomzhf
2003-07-22
打赏
举报
回复
var nFrom =1;
var nTo = 2;
for(var i = 0;i < table.rows.length;i++)
{
table.rows[i].cells[nFrom].swapNode(table.rows[i].cells[nFrom])
}
你看行不
R语言使用
table
函数
和xtabs
函数
计算获取二维
列
联表(TWO-WAY
TABLE
S)的语法、使用xtabs
函数
计算获取二维
列
联表(TWO-WAY
TABLE
S)
R语言使用
table
函数
和xtabs
函数
计算获取二维
列
联表(TWO-WAY
TABLE
S)的语法、使用xtabs
函数
计算获取二维
列
联表(TWO-WAY
TABLE
S)
用javascript实现
Table
的行
列
互换
网上的一些实现
table
行
列
互换
的例子,大部分是针对所有单元格的rowspan和colspan都等于1,而且形状为矩形的
table
。参考这些代码,我用javascript实现了较复杂的
table
的行
列
互换
。 我要转换的
table
满足以下的条件:
table
的形状必须是矩形的; 每一行都至少有一个单元格的rowspan等于1,其他的单元格的row
Hive中行转
列
和
列
转行
函数
hive中行转
列
和
列
转行
函数
简述
Hive/Spark SQL常用
函数
(窗口分析
函数
、行
列
转换、JSON处理)
文章目录 窗口分析
函数
1. 分析
函数
2. 聚合
函数
3. 窗口
函数
行
列
转换 1. 行转
列
2.
列
转行 JSON处理 1. JSON对象 2. JSON数组 Hive SQL Spark SQL 时间处理 窗口分析
函数
函数
中用到的表数据如下图: 1. 分析
函数
row_number() rank() dense_rank() 这3个
函数
通常用在组内.
postgresql行
列
转换
函数
postgresql行
列
转换
函数
Pg提供相关行
列
转换
函数
string_agg和regexp_split_to_
table
。 1、行转
列
:string_agg 测试表 postgres=# select * from test.test_copy ; eno | ename | job | mgr | hiredate | sal | comm | de...
JavaScript
87,997
社区成员
224,709
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章