<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动态表格的更多相关文章

  1. 在<s:iterator>标签里给动态表格添加序号

    在<s:iterator>标签里给动态表格添加序号,需要用到<s:iterator>标签里的Status属性里的count eg:<s:iterator value=&q ...

  2. HTML5&CSS3经典动态表格

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. 5.11-5.15javascript制作动态表格

    制作动态表格的主要是运用js中表格类的insertRow.insertCell简易添加行和列的代码,不过要注意每行添加的表格是有位置行编号的,每行的编号为rows.length-1,增加的表格内的标签 ...

  4. Vue+Element的动态表单,动态表格(后端发送配置,前端动态生成)

    Vue+Element的动态表单,动态表格(后端发送配置,前端动态生成) 动态表单生成 ElementUI官网引导 Element表单生成 Element动态增减表单,在线代码 关键配置 templa ...

  5. jQuery的下面是动态表格动态表单中的HTML代码

    动态表格动态表单中的Jquery代码 <script type="text/javascript" src="/include/jquery/jquery-1.1. ...

  6. JavaScript 创建动态表格

    JavaScript 创建动态表格 版权声明:未经授权,严禁转载! 案例代码 <div id="data"></div> <script> va ...

  7. Java利用poi生成word(包含插入图片,动态表格,行合并)

    转(小改): Java利用poi生成word(包含插入图片,动态表格,行合并) 2018年12月20日 09:06:51 wjw_11093010 阅读数:70 Java利用poi生成word(包含插 ...

  8. jQuery动态表格插件 AppendGrid

    AppendGrid是一个jQuery动态表格插件,提供像填写电子表格数据一样在页面去输入结构化数据. 它允许用户在表格里增加/删除/插入/删除行,控制input/select/textarea 提交 ...

  9. 查询表格——建立动态表格,使用ajax输入查询条件将后台数据查询出来以表格的形式展示出来

    建立动态表格,使用ajax将前台查询条件传给后台,并将查询结果以表格的形式展示出来. 页面的展示效果如下图所示: 第一步:查询条件的部分: 代码如下: <div class="text ...

随机推荐

  1. 1034 Head of a Gang (30)(30 分)

    One way that the police finds the head of a gang is to check people's phone calls. If there is a pho ...

  2. BZOJ3230 相似子串[后缀数组+二分+st表]

    BZOJ3230 相似子串 给一个串,查询排名i和j的子串longest common suffix和longest common prefix 思路其实还是蛮好想的,就是码起来有点恶心.可以发现后缀 ...

  3. 使用ubuntu自带的Remmina Remote Desktop Client远程登录服务器配置

    1.配置:点击new , 配置服务器ip地址.名称.密码 2.打开本机终端执行一下命令: echo xfce4-session>.session echo xfce4-session>.x ...

  4. C++常见错误总结

    1.  error C2871: 'std' : does not exist or is not a namespace 原来 C++有两个不同版本的头文件.引入名字空间这个概念以前编译器用的是#i ...

  5. hash tree

    http://en.wikipedia.org/wiki/Hash_list In computer science, a hash list is typically a list of hashe ...

  6. jq操作select集合

    jq操作select集合 时间:2012年12月07日分类:Javascript 最近一段时间发现,老是要跟select,option相关的东西打交道,而且有的时候还会搞错,于是,抽了一点时间整理了一 ...

  7. 网络爬虫之Xpath用法汇总

    众所周知,在设计爬虫时,最麻烦的一步就是对网页元素进行分析,目前流行的网页元素获取的工具有BeautifulSoup,lxml等,而据我使用的体验而言,Scrapy的元素选择器Xpath(结合正则表达 ...

  8. POJ 1064 Cable master (二分)

    题意:给定 n 条绳子,它们的长度分别为 ai,现在要从这些绳子中切出 m 条长度相同的绳子,求最长是多少. 析:其中就是一个二分的水题,但是有一个坑,那么就是最后输出不能四舍五入,只能向下取整. 代 ...

  9. js.alert(重写)

    function dialogFn(Msg, btnOkCallBack, btnCancelCallBack) { $("body").append('<div id=&q ...

  10. 用Python分析国民生产总值

    今天学习Python的matplotlib,书上的一道例题感觉写的很好(黄红梅的Python数据分析与应用),就是 利用matplotlib的各种图来对2000-2017年季度生产总值进行分析,这道题 ...