社区
JavaScript
帖子详情
菜鸟问:如何获得table的第一个dr对象?tablename.children[0]不是啊
jie1999
2003-10-16 09:04:21
如题
...全文
60
6
打赏
收藏
菜鸟问:如何获得table的第一个dr对象?tablename.children[0]不是啊
如题
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
seeu1688
2004-01-03
打赏
举报
回复
若用dom方式访问,所有<tr>对象都有一个叫<tbody>的父对象。
即<table>下先是<tbody>再是<tr>
<body>
<table id=tblid border=1>
<tr>
<td>11</td>
<td>12</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
</tr>
</table>
<button onclick="getFirstTr()">Fisrt TR element</button><br>
<button onclick="getFirstTd()">Fisrt TD element</button>
<script language="JavaScript">
<!--
function getFirstTr()
{
alert(tblid.children[0].children[0].innerHTML);
alert(tblid.firstChild.firstChild.innerHTML);
}
function getFirstTd()
{
alert(tblid.children[0].children[0].children[0].innerHTML);
alert(tblid.firstChild.firstChild.firstChild.innerHTML);
}
//-->
</script>
</body>
JMANYICZF
2004-01-02
打赏
举报
回复
自定义标记?
descreekert
2003-10-16
打赏
举报
回复
是 tr 还是 td 啊,没有见过 dr 对象的。
如果是 tr 用 tablename.rows[0]
如果是 td 用 tablename.rows[0].cells[0]
nolonely
2003-10-16
打赏
举报
回复
document.all("table1").rows[0].cells[0].style.width="100"
jie1999
2003-10-16
打赏
举报
回复
我是想设置这个table每列的宽度,现在只有这个table的id,怎么办?
jie1999
2003-10-16
打赏
举报
回复
Could someone help?
table
.getn(
table
Name) 的用法注意。
转自:http://blog.sina.com.cn/s/blog_4a2e9af90100cv1z.html
1.
table
.getn(
table
Name)
--等同于操作符 #
作用:得到一个
table
的大小。
注意:该
table
的key必须是有序的,索引是从1开始的。
例如:
a)有序
table
:
local
table
1 = {10, 2
MybatisPlus学习〖四〗报错篇 WARNWarn: Could not find @
Table
Id in Class: com.fehead.OceanCode.dataobject
在使用MP的时候给Warning了 WARNWarn: Could not find @
Table
Id in Class: com.fehead.OceanCode.dataobject.GroupFileDO. WARNWarn: Could not find @
Table
Id in Class: com.fehead.OceanCode.dataobject.GroupInfoDO. WARN...
tp5sql语句,Db::
table
(),与Db::name()的细小区别
tp5中db::
table
和db::name的区别 $user=Db::
table
('$
table
name');含前缀;("数据库表的全名") $user=Db::name('$name');不含前缀;("去掉表前缀的数据库表名"。这个方法会自己去读取数据库配置文件中的表前缀那个配置) 参考资料:https://www.cnblogs.com/sccwxl/p/9945003.html 其...
Db::
table
与Db::name的区别!
$user=Db::
table
('$
table
name');含前缀 $user=Db::name('$name');不含前缀
Caused by: io.seata.common.exception.ShouldNeverHappenException: Could not found any index in the ta
java.sql.SQLException: Failed to fetch schema of
table
name Caused by: io.seata.common.exception.ShouldNeverHappenException: Could not found any index in the
table
:
table
name io.seata.common.exception.ShouldNeverHappenException: [xid:10.2.30.38:30109:5676
JavaScript
87,910
社区成员
224,616
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章