//oTable表id
function addRow(FeeItem, Fee, FeeType){
oRow = oTable.insertRow(oTable.rows.length);
oRow.runtimeStyle.backgroundColor = "#e8e9fc";
oCell1 = oRow.insertCell(oRow.cells.length);
oCell2 = oRow.insertCell();
oCell3 = oRow.insertCell();
oCell1.innerText = "00l";
oCell2.innerText = "002";
oCell3.innerText = "003";
oTable.style.display = "inline";
}
function addRow(FeeItem, Fee, FeeType){
oRow = oTable.insertRow(oTable.rows.length);
oRow.runtimeStyle.backgroundColor = "#e8e9fc";
oCell1 = oRow.insertCell(oRow.cells.length);
oCell2 = oRow.insertCell();
oCell3 = oRow.insertCell();
oCell1.innerText = "00l";
oCell2.innerText = "002";
oCell3.innerText = "003";
oTable.style.display = "inline";
}
解决方案 »
- 在jsp页面里把textarea传入oracle数据库,中文乱码,怎么解决?
- soapUI性能测试某个webservice,thread多是出现的错误,JAVA盲求分析
- 寻找一个支持中文URL编码的JSP 服务器
- 如何获得某网站的IP和端口
- JBuilder如果自定义标签
- 一个Action怎么能够带参数跳转到另一个Action中去?
- 菜鸟问题:如何让jsp来获取与之关联的java 数据(赚分了)
- WEB项目通过IE代理访问问题
- hibernate报NullPointerException,求解答!!
- Oracle
- 如何将JSP中TABLE上的数据填写到EXCEL中,据说有个类可实现谁知道
- jsp中关于iframe中的表单提交!
<table>
<%
ResultSet rs;
……………………
while(rs.next())
{
%>
<tr>
<td><%=rs.getString(1)%></td>
<tr>
<%
}
%>
</table>
<%
ResultSet rs;
……………………
while(rs.next())
{
%>
<tr>
<td><%=rs.getString(1)%></td>
<td><%=rs.getString(2)%></td>
<td><%=rs.getString(3)%></td>
..........
<tr>
<%
}
%>
</table>
<%
ResultSet rs;
<tr>
while(rs.next())
{
%>
<td><%=rs.getString(1)%></td>
<td><%=rs.getString(2)%></td>
<td><%=rs.getString(3)%></td>
..........
<%
}
%>
<tr>
</table>
-------------------------------------------
项目名称 | 记录1 | 记录2 | 记录3
-------------------------------------
数值1 | 2.34 | 3.45 | 34.56
------------------------------------------
数值2 | 2.34 | 3.45 | 34.56
------------------------------------------
合计 | 4.68 | 7.90 | 69.12我想用循环按记录逐条增加纵行,也就是一个col,而不是row
<head>
<title>Table Object method</title>
<script language="JavaScript">
var intRowIndex = 0;
function insertRow(tbIndex){
var objRow = myTable.insertRow(tbIndex);
var objCel = objRow.insertCell(0);
objCel.innerText = document.myForm.myCell1.value;
var objCel = objRow.insertCell(1);
objCel.innerText = document.myForm.myCell2.value;
objRow.attachEvent("onclick", getIndex);
objRow.style.background = "pink";
}
function deleteRow(tbIndex){
myTable.deleteRow(tbIndex);
}
function getIndex(){
intRowIndex = event.srcElement.parentElement.rowIndex;
pos.innerText = intRowIndex;
}
</script>
</head>
<body onload="pos.innerText=intRowIndex;">
<h2>Table Object method</h2>
<hr>
Current Loction: <span id="pos"></span>
<table id="myTable" border=1>
<tr onclick="getIndex()">
<td>HTML</td>
<td>CSS</td>
</tr>
<tr onclick="getIndex()">
<td>JavaScript</td>
<td>VBScript</td>
</tr>
</table>
<form name="myForm">
The First Line: <input type="text" name="myCell1" value="CGI"><br/>
The Second Line: <input type="text" name="myCell2" value="ASP"><br/>
<input type="button" onclick="insertRow(intRowIndex)" value="Add Row">
<input type="button" onclick="deleteRow(intRowIndex)" value="Del Row">
<input type="button" onclick="insertRow(myTable.rows.length);" value="Add Row">
</form>
</body>
</html>