asp.net web数据库控件内table(包括嵌套table)的边线问题

简介:      在做数据绑定显示的时候,经常会遇到这样的情况,使用一些asp.net web数据库控件,如Repeater、FormView等,里面的模板里使用table,还有可能是多个数据控件...

     在做数据绑定显示的时候,经常会遇到这样的情况,使用一些asp.net web数据库控件,如Repeater、FormView等,里面的模板里使用table,还有可能是多个数据控件嵌套,里面有多个table,这样就能显示各种复杂的表格,但是table表格的边框线,就是一个问题,经常会遇到边线重复,就造成边线加粗的情形,怎么解决?


先总结一下,备忘:

<style type="text/css">
        body
        {
            font-size: 12px;
        }
        td
        {
            font-size: 12px;   height: 20px; line-height: 20px; height:20px;
        }
        .table
        {
            border-right: black 1px solid;
            border-bottom: black 1px solid;
        }
        .table td
        {
            border-top: black 1px solid;
            border-left: black 1px solid;
        }
</style>

<asp:FormView ID="FormView1" runat="server" DataKeyNames="ID" DataSourceID="SqlDataSource1"
        Width="100%" Font-Size="Medium">
        <ItemTemplate>
            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <table width="100%" class="table" cellpadding="0" cellspacing="0">
                            <tr>
                                <td align="center" style="font-weight: bold; height: 30px; width: 3%">
                                    单位
                                </td>
                                <td align="center" colspan="5" style="width: 97%">
                                     <asp:Label ID="lbldw" runat="server" Text='<%#Eval("单位") %>'></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style="font-weight: bold; height: 30px; width: 10%">
                                    检查时间
                                </td>
                                <td align="center" colspan="2">
                                     <asp:Label ID="lbljcsj" runat="server" Text='<%#ConvertTime(Eval("检查时间").ToString()) %>'></asp:Label>
                                </td>
                                <td align="center" style="font-weight: bold; height: 30px; width: 10%">
                                    检查内容
                                </td>
                                <td align="center" colspan="2">
                                     <asp:Label ID="lbljcnr" runat="server" Text='<%#Eval("检查内容") %>'></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style="font-weight: bold; height: 30px; width: 10%">
                                    参加人员
                                </td>
                                <td align="center" colspan="5">
                                     <asp:Label ID="lblcjry" runat="server" Text='<%#Eval("参加人员") %>'></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style="font-weight: bold; height: 30px; width: 10%">
                                    隐患登记
                                </td>
                                <td align="center" colspan="5">
                                     <asp:Label ID="lblyhdj" runat="server" Text='<%#Eval("隐患登记") %>'></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style="font-weight: bold; height: 30px; width: 3%">
                                    序号
                                </td>
                                <td align="center" style="font-weight: bold; height: 30px; width: 14%">
                                    隐患部位
                                </td>
                                <td align="center" style="font-weight: bold; height: 30px; width: 34%">
                                    隐患内容
                                </td>
                                <td align="center" style="font-weight: bold; height: 30px; width: 14%">
                                    整改责任人
                                </td>
                                <td align="center" style="font-weight: bold; height: 30px; width: 14%">
                                    限定日期
                                </td>
                                <td align="center" style="font-weight: bold; height: 30px; width: 19%">
                                    完成情况
                                </td>
                            </tr>
                            <tr>
                                <td align="center" id="One_td1" runat="server">
                                     
                                </td>
                                <td align="center" id="Two_td1" runat="server">
                                     
                                </td>
                                <td align="center" id="Three_td1" runat="server">
                                     
                                </td>
                                <td align="center" id="Four_td1" runat="server">
                                     
                                </td>
                                <td align="center" id="Five_td1" runat="server">
                                     
                                </td>
                                <td align="center" id="Six_td1" runat="server">
                                     
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style="font-weight: bold; height: 30px; width: 10%">
                                    备注
                                </td>
                                <td align="center" colspan="5">
                                     <asp:Label ID="lblbz" runat="server" Text='<%#Eval("备注") %>'></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style="font-weight: bold; height: 30px; width: 10%">
                                    单位负责人
                                </td>
                                <td colspan="2" align="center">
                                     <asp:Label ID="lbldwfzr" runat="server" Text='<%#Eval("单位负责人") %>'></asp:Label>
                                </td>
                                <td align="center" style="font-weight: bold; height: 30px; width: 10%">
                                    记录
                                </td>
                                <td colspan="2" align="center">
                                     <asp:Label ID="lbljlr" runat="server" Text='<%#Eval("记录人") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
        <PagerStyle BorderColor="White" />
        <RowStyle BorderColor="White" />
    </asp:FormView>
效果图如下:


相关文章
|
3月前
|
开发框架 Oracle 关系型数据库
ASP.NET实验室LIS系统源码 Oracle数据库
LIS是HIS的一个组成部分,通过与HIS的无缝连接可以共享HIS中的信息资源,使检验科能与门诊部、住院部、财务科和临床科室等全院各部门之间协同工作。 
41 4
|
2月前
|
存储 缓存 NoSQL
在Python Web开发过程中:数据库与缓存,Redis在Web开发中的常见应用场景有哪些?
Redis在Python Web开发中常用于缓存、会话管理、分布式锁、排行榜、消息队列和实时分析。作为内存数据存储,它提供高效的数据结构(如字符串、哈希、列表、集合、有序集合),支持会话存储、互斥操作、计数与排名、队列实现及实时数据处理。其高速性能和丰富功能使其成为多场景下的理想选择。
25 5
|
14天前
|
开发框架 缓存 前端开发
利用Visual Basic构建高效的ASP.NET Web应用
【4月更文挑战第27天】本文探讨使用Visual Basic与ASP.NET创建高效Web应用的策略,包括了解两者基础、项目规划、MVC架构、数据访问与缓存、代码优化、异步编程、安全性、测试及部署维护。通过这些步骤,开发者能构建出快速、可靠且安全的Web应用,适应不断进步的技术环境。
|
2天前
|
XML 开发框架 .NET
C#/ASP.NET应用程序配置文件app.config/web.config的增、删、改操作
C#/ASP.NET应用程序配置文件app.config/web.config的增、删、改操作
|
5天前
|
SQL 存储 C#
C# Web控件与数据感应之 TreeView 类
C# Web控件与数据感应之 TreeView 类
|
5天前
|
SQL 存储 Oracle
C# Web控件与数据感应之 CheckBoxList 类
C# Web控件与数据感应之 CheckBoxList 类
|
5天前
|
SQL 存储 Oracle
C# Web控件与数据感应之 Control 类
C# Web控件与数据感应之 Control 类
|
5天前
|
SQL 存储 Oracle
C# Web控件与数据感应之 ListControl 类
C# Web控件与数据感应之 ListControl 类
|
12天前
|
API 数据库 Python
Python web框架fastapi数据库操作ORM(二)增删改查逻辑实现方法
Python web框架fastapi数据库操作ORM(二)增删改查逻辑实现方法
|
12天前
|
关系型数据库 MySQL API
Python web框架fastapi数据库操作ORM(一)
Python web框架fastapi数据库操作ORM(一)