原创 html动态表格
<table id="opttb">
<asp:Repeater ID="tempOptions" runat="server">
<ItemTemplate>
<tr ondblclick="tt(this)">
<td><%#Eval("XH")%></td>
<td><%#Eval("XXBH")%></td>
<td><%#Eval("XXMC")%></td>
<td><%#Eval("ISOK")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
html动态表格后台
protected void DelOption_Click(object sender, EventArgs e)
{
var templist = new List<tableModel>();
var DelNO = this.DelNO.Value;
if (Session["tempdate"] != null)
{
var tempdata1 = Session["tempdate"] as List<tableModel>; for (int i = ; i < tempdata1.Count; i++)
{
templist.Add(tempdata1[i]);
}
}
templist.RemoveAt(Convert.ToInt16(DelNO.Substring(, ))); list.Clear(); for (int k = ; k < templist.Count; k++)
{
tableModel tm = new tableModel();
tm.XH = k.ToString();
tm.XXBH = NumtoChar(k.ToString());
tm.XXMC = templist[k].XXMC;
tm.ISOK = templist[k].ISOK;
tm.Remark = templist[k].Remark;
list.Add(tm);
} this.tempOptions.DataSource = ToDataTable(list);
tempOptions.DataBind();
templist.Clear();
list.Clear(); } protected void addOption_Click(object sender, EventArgs e)
{
if (Session["tempdate"] != null)
{
var tempdata1 = Session["tempdate"] as List<tableModel>;
for (int i = ; i < tempdata1.Count; i++)
{
list.Add(tempdata1[i]);
}
}
tableModel tm = new tableModel();
tm.XH = (list.Count).ToString();
tm.XXBH = NumtoChar(tm.XH);
tm.XXMC = this.Questions.Text;
tm.ISOK = this.ISOK1.Checked == true ? "否" : "是";
tm.Remark = this.Remark.Text;
var tt = ISOK2.Checked;
list.Add(tm);
this.tempOptions.DataSource = ToDataTable(list);
tempOptions.DataBind();
Session["tempdate"] = list;
list.Clear();
} public static DataTable ToDataTable(IList list)
{
DataTable result = new DataTable();
if (list.Count > )
{
PropertyInfo[] propertys = list[].GetType().GetProperties();
foreach (PropertyInfo pi in propertys)
{
result.Columns.Add(pi.Name, pi.PropertyType);
} for (int i = ; i < list.Count; i++)
{
ArrayList tempList = new ArrayList();
foreach (PropertyInfo pi in propertys)
{
object obj = pi.GetValue(list[i], null);
tempList.Add(obj);
}
object[] array = tempList.ToArray();
result.LoadDataRow(array, true);
}
}
return result;
}
原创 html动态表格的更多相关文章
- 在<s:iterator>标签里给动态表格添加序号
在<s:iterator>标签里给动态表格添加序号,需要用到<s:iterator>标签里的Status属性里的count eg:<s:iterator value=&q ...
- HTML5&CSS3经典动态表格
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 5.11-5.15javascript制作动态表格
制作动态表格的主要是运用js中表格类的insertRow.insertCell简易添加行和列的代码,不过要注意每行添加的表格是有位置行编号的,每行的编号为rows.length-1,增加的表格内的标签 ...
- Vue+Element的动态表单,动态表格(后端发送配置,前端动态生成)
Vue+Element的动态表单,动态表格(后端发送配置,前端动态生成) 动态表单生成 ElementUI官网引导 Element表单生成 Element动态增减表单,在线代码 关键配置 templa ...
- jQuery的下面是动态表格动态表单中的HTML代码
动态表格动态表单中的Jquery代码 <script type="text/javascript" src="/include/jquery/jquery-1.1. ...
- JavaScript 创建动态表格
JavaScript 创建动态表格 版权声明:未经授权,严禁转载! 案例代码 <div id="data"></div> <script> va ...
- Java利用poi生成word(包含插入图片,动态表格,行合并)
转(小改): Java利用poi生成word(包含插入图片,动态表格,行合并) 2018年12月20日 09:06:51 wjw_11093010 阅读数:70 Java利用poi生成word(包含插 ...
- jQuery动态表格插件 AppendGrid
AppendGrid是一个jQuery动态表格插件,提供像填写电子表格数据一样在页面去输入结构化数据. 它允许用户在表格里增加/删除/插入/删除行,控制input/select/textarea 提交 ...
- 查询表格——建立动态表格,使用ajax输入查询条件将后台数据查询出来以表格的形式展示出来
建立动态表格,使用ajax将前台查询条件传给后台,并将查询结果以表格的形式展示出来. 页面的展示效果如下图所示: 第一步:查询条件的部分: 代码如下: <div class="text ...
随机推荐
- 「USACO08DEC」「LuoguP2922」秘密消息Secret Message(AC自动机
题目描述 Bessie is leading the cows in an attempt to escape! To do this, the cows are sending secret bin ...
- ACM学习历程—POJ1151 Atlantis(扫描线 && 线段树)
Description There are several ancient Greek texts that contain descriptions of the fabled island Atl ...
- 树——平衡二叉树插入和查找的JAVA实现
package com.tomsnail.data.tree; /** * AVL二叉平衡树 * @author tomsnail * @date 2015年3月30日 下午4:35:50 */ pu ...
- 搭建基于Nagios的监控系统——之监控远程Windows服务器
分享了如何监控Linux服务器,我们来看看使用Nagios如何监控Windows服务器. 第一部分:配置被监控的Windows服务器 首先,访问 http://sourceforge.net/pr ...
- fabric优先级,进程管理
fabric在执行一些命令或者脚本的时候,会执行了操作,但是,进程启动失败,google,发现fabric在执行脚本或者进程的时候,加入set -m参数,就可以正常运行了,解释是:"set ...
- <c++primer plus>学习笔记1之第八章函数探幽
1 c++内联函数 编译器将使用相应的函数代码替换函数调用,对于内联代码,函数无需跳到另一个位置执行代码再跳回来,所以内联函数运行速度比常规函数快. 但是代价是需要更多的内存. 使用场合: 执行函数代 ...
- ubuntu系统开root以及(su:认证失败)完美解决
开机进入桌面,ctrl+alt+T打开终端————在此时终端显示的是 用户名@电脑名:-$ 表示普通用户 在此处输入:sudo passwd root 此时提示———— [sudo] passwo ...
- js如何判断当前文本的输入状态——中文输入法的那些坑
相信各位在平时接需求的时候肯定会遇到这样的一些需求,例如,要求输入框限制输入长度,限制输入类型,限制只能英文输入,限制只能输入大写字母等等,这时候我们一般的思路无非两种,一种是弹出特定的键盘,第二种是 ...
- Working Experience - How to handle the destroyed event of UserControl
正文 问题: UserControl 如何在父窗体(程序)关闭时, 释放一些需要手动释放的资源 方法: 使用 Control.FindForm() 获取父窗体, 从而得到父窗体的 Closing/Cl ...
- LeetCode: 371 Sum of Two Integers(easy)
题目: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. ...