日期:2014-05-17 浏览次数:20739 次
<table border="1"> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> <script> $("table td:contains(' ')").each(function(index, obj){ $(obj).html("index" + index); }); </script>
------解决方案--------------------
如果你有用过jquery:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript" src="jquery-1.6.2.js"></script>换成你的版本
<script language="javascript">
$(function(){
$("#GridView1 td").each(function(index, element) {
alert($(element).text())的到的数据,你自己组装成你的
});
});
</script>
</head>
<body>
<TABLE id='GridView1'>
<TBODY >
<TR>
<TD>DKI</TD>
<TD>DATE</TD>
<TD>DKI</TD>
<TD>DATE</TD>
<TD>DKI</TD>
<TD>DATE</TD>
<TD>DKI</TD>
<TD>DATE</TD>
<TD>DKI</TD>
<TD>DATE</TD>
<TD>DKI</TD>
<TD>DATE</TD>
<TD>DKI</TD>
<TD>DATE</TD>
<TD>DKI