display:table表格合并单元格

直接上代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/commons/include/html_doctype.html" %>
<html>
<head>
<title>补贴项目属性管理</title>
<%@include file="/commons/include/get.jsp" %>
<script type="text/javascript"> 
    function fixRowspan() { 
        var tb = document.getElementById("projectPropertyItem"); 
        var row_span_num = 1; 
        var first_row_title = ""; 
        var first_row_obj = null; 
        for ( var i = 1; i < tb.rows.length; i++) { 
            var first_new_row_title = tb.rows[i].cells[0].innerHTML; 
            if (first_row_title != "" && first_row_title == first_new_row_title) { 
                tb.rows[i].deleteCell(0); 
                row_span_num++; 
                first_row_obj.setAttribute("rowSpan", row_span_num); 
                first_row_obj.innerHTML = first_row_title.replace("/", "<br/>"); 
            } else { 
                if (first_row_title != "") { 
                    first_row_obj.setAttribute("rowSpan", row_span_num); 
                    first_row_obj.innerHTML = first_row_title.replace("/", "<br/>"); 
                    row_span_num = 1; 
                
                first_row_obj = tb.rows[i].cells[0]; 
                first_row_title = first_new_row_title; 
            
        
   
    
</script>
</head>
<body onload="fixRowspan()">
    <div class="panel">
        <div class="panel-top">
            <div class="tbar-title">
                <span class="tbar-label">补贴项目属性管理列表</span>
            </div>
            <div class="panel-toolbar">
                <div class="toolBar">
                    <div class="group"><a class="link search" id="btnSearch"><span></span>查询</a></div>
                    <div class="l-bar-separator"></div>
                </div>   
            </div>
            <div class="panel-search">
                <form id="searchForm" method="post" action="list.ht">
                    <div class="row">
                        <span class="label">补贴项目:</span><!-- <input type="text" name="Q_projectId_SL"  class="inputText" /> -->
                        <select name="Q_projectId_S" style="width:20% !important;" class="inputText">
                            <option value="">---请选择---</option>
                            <c:forEach items="${projectList }" var="project">
                            <option value="${project.id }" <c:if test="${param.Q_projectId_S eq  project.id}">selected="selected"</c:if>>${project.projectName }</option>
                            </c:forEach>
                        </select>
                    </div>
                </form>
            </div>
        </div>
        <div class="panel-body">
            <display:table name="projectPropertyList" id="projectPropertyItem" requestURI="list.ht" sort="external" cellpadding="1" cellspacing="1" class="table-grid">
                <display:column property="projectName" title="项目名称" style="text-align:center;" sortName="PROJECT_NAME">
                </display:column>
                <display:column property="propName" title="属性名称" sortName="PROP_NAME" style="text-align:center;" ></display:column>
                <display:column title="数据类型" style="text-align:center;" sortName="DATA_TYPE">
                    <c:forEach items="${Dictionary.DATA_TYPE }" var="item">
                        <c:if test="${projectPropertyItem.dataType eq item.itemValue }" >${item.itemName }</c:if>
                    </c:forEach>
                </display:column>
                <display:column title="属性类型" style="text-align:center;" sortName="PROP_TYPE">
                    <c:forEach items="${Dictionary.PROPERTY_TYPE}" var="item">
                        <c:if test="${projectPropertyItem.propType eq item.itemValue }">${item.itemName }</c:if>
                    </c:forEach>
                </display:column>
                <display:column title="计算单位" style="text-align:center;" sortName="COUNT_UNIT">
                    <c:forEach items="${Dictionary.COMPUTING_UNIT}" var="item">
                        <c:if test="${projectPropertyItem.countUnit eq item.itemValue }">${item.itemName }</c:if>
                    </c:forEach>
                </display:column>
                <display:column property="createUserName" title="创建人" style="text-align:center;" sortName="CREATE_BY"></display:column>
                <display:column  title="创建时间" style="text-align:center;" sortName="CREATE_TIME">
                    <fmt:formatDate value="${projectPropertyItem.createTime}" pattern="yyyy-MM-dd"/>
                </display:column>
                <display:column title="管理" media="html">
                    <c:if test="${project.state eq 'NOT_FINISH'}">
                        <a href="del.ht?id=${projectPropertyItem.id}" class="link del">删除</a>
                        <a href="edit.ht?id=${projectPropertyItem.id}" class="link edit">编辑</a>
                    </c:if>
                    <a href="get.ht?id=${projectPropertyItem.id}" class="link detail">明细</a>
                </display:column>
            </display:table>
            <ksource:paging tableId="projectPropertyItem"/>
        </div><!-- end of panel-body -->               
    </div> <!-- end of panel -->
</body>
</html>

效果图:

 

posted @   岁月淡忘了谁  阅读(5393)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示