惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
V
Visual Studio Blog
Jina AI
Jina AI
云风的 BLOG
云风的 BLOG
C
Check Point Blog
M
MIT News - Artificial intelligence
罗磊的独立博客
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
S
Secure Thoughts
酷 壳 – CoolShell
酷 壳 – CoolShell
Application and Cybersecurity Blog
Application and Cybersecurity Blog
B
Blog
N
News | PayPal Newsroom
爱范儿
爱范儿
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
P
Privacy International News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Archives - TechRepublic
Security Archives - TechRepublic
Scott Helme
Scott Helme
V2EX - 技术
V2EX - 技术
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Simon Willison's Weblog
Simon Willison's Weblog
H
Help Net Security
大猫的无限游戏
大猫的无限游戏
K
Kaspersky official blog
雷峰网
雷峰网
IT之家
IT之家
Vercel News
Vercel News
S
Schneier on Security
Schneier on Security
Schneier on Security
C
CERT Recently Published Vulnerability Notes
博客园_首页
T
Tailwind CSS Blog
T
The Exploit Database - CXSecurity.com
F
Full Disclosure
博客园 - 司徒正美
The Cloudflare Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cisco Blogs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
P
Proofpoint News Feed
F
Fortinet All Blogs
有赞技术团队
有赞技术团队
S
Security Affairs
Latest news
Latest news

博客园 - 叶子绿了

freemarker显示含有html代码的内容 .net sql 防注入 httpmodule [转载]poi导出excel,可以自定义保存路径 jquery ajax 传递js对象到后台 Struts2下多文件的上传与下载 dwr框架 Oracle 9i中包含Connect by 子句的查询向Oracle 10g移植后运行时错误及解决方法 JQuery Uploadify 基于JSP的无刷新上传实例 写了个用jquery控制select只读(select选项可以供用户查看但不能改变初始选中值) C#之模态窗口关闭 在Web站点中创建和使用Rss源(动态) silverlight xml查询 silverlight 3 数据绑定及分页 解决ASP.NET中Image控件不能自动刷新 解决UpdatePanel无法直接弹出窗口的问题 导入Excel数值读不到,找不到可安装的 ISAM错误! asp.net2.0 上传大容量文件第三方控件radupload 浏览器不能正常解析CSS代码的解决 ajax在用户注册中的应用,类似淘宝网
repeater相同行合并
叶子绿了 · 2010-10-29 · via 博客园 - 叶子绿了

代码

<table  width="100%"    id="mytable" >
    
<tr align="center">
      
<th>学号</th><th>姓名</th><th>起止时间</th> <th>学习(或工作)单位</th> <th>职务</th> <th>证明人</th> <th>备注</th>
    
</tr>
    
<asp:Repeater ID="Repeater1" runat="server" onprerender="Repeater1_PreRender">
    
<ItemTemplate>
    
<tr><td id="tdxuehao" runat="server">&nbsp;<%#Eval("xuehao"%></td><td id="tdxsname" runat="server">&nbsp;<%#Eval("xsname")%></td><td>&nbsp;<%#Eval("qzsj")%></td> <td>&nbsp;<%#Eval("grjl")%></td> <td>&nbsp;<%#Eval("zw")%></td> <td>&nbsp;<%#Eval("zmr")%></td> <td>&nbsp;<%#Eval("bz")%></td>
    
</tr>
    
</ItemTemplate>
    
</asp:Repeater>
    
       
</table>

代码

protected void Repeater1_PreRender(object sender, EventArgs e)
        {
            
for (int i = Repeater1.Items.Count - 1; i > 0; i--)
            {
                
//tcid是需要合并列的列名
                HtmlTableCell oCell_previous = Repeater1.Items[i - 1].FindControl("tdxuehao"as HtmlTableCell;
                HtmlTableCell oCell 
= Repeater1.Items[i].FindControl("tdxuehao"as HtmlTableCell;
                
if (oCell_previous != null && oCell != null)
                {
                    oCell.RowSpan 
= (oCell.RowSpan == -1? 1 : oCell.RowSpan;
                    oCell_previous.RowSpan 
= (oCell_previous.RowSpan == -1? 1 : oCell_previous.RowSpan;if (oCell.InnerText == oCell_previous.InnerText)
                    {
                        oCell.Visible 
= false;
                        oCell_previous.RowSpan 
+= oCell.RowSpan;
                    }
                }

                HtmlTableCell nameprevious 

= Repeater1.Items[i - 1].FindControl("tdxsname"as HtmlTableCell;
                HtmlTableCell name 
= Repeater1.Items[i].FindControl("tdxsname"as HtmlTableCell;
                
if (nameprevious != null && name != null)
                {
                    name.RowSpan 
= (name.RowSpan == -1? 1 : name.RowSpan;
                    nameprevious.RowSpan 
= (nameprevious.RowSpan == -1? 1 : nameprevious.RowSpan;if (name.InnerText == nameprevious.InnerText)
                    {
                        name.Visible 
= false;
                        nameprevious.RowSpan 
+= name.RowSpan;
                    }
                }
            }

        }