zoukankan      html  css  js  c++  java
  • 动态生成Table

    Script:

     <tr>

                <td valign="top">

                    <table style="100%; border-color:Gray; border-style:double; border-3">

                        <%=ViewState["ViewCarePlanRiskFactors"]%>

                    </table>

                </td>

                <td valign="top">

                    <table style="100%; border-color:Gray; border-style:double; border-3">

                        <%=ViewState["ViewCarePlanGoals/Instructions"]%>

                    </table>

                </td>

                <td valign="top">

                    <table style="100%; border-color:Gray; border-style:double; border-3">

                        <%=ViewState["ViewCarePlanInterventions"]%>

                    </table>

                </td>

                <td valign="top">

                    <table style="100%; border-color:Gray; border-style:double; border-3">

                        <%=ViewState["ViewPlanMedications"]%>

                        <%=ViewState["ViewCarePlanOtherMedications"]%>

                    </table>

                </td>

                <td valign="top">

               <asp:Label runat="server" ID="lblPractitioner"/>

                </td>

            </tr>

    Code:

        protected void CreateSectionAndItemStrBasic(Dictionary<string, MyBasicProtocolStructure[]> dictStruc,

                Dictionary<string, MyPatientProtocolItem[]> dictPatientItem,ref string str, string prefixstr, string parentId)

            {

                if (dictStruc.ContainsKey(parentId))

                {

                    MyBasicProtocolStructure[] myBasicProtocolStruList = dictStruc[parentId] as MyBasicProtocolStructure[];

                    foreach (MyBasicProtocolStructure myBasicProtocolStruc in myBasicProtocolStruList)

                    {

                        str += "<tr><td>" + prefixstr + myBasicProtocolStruc.Name + "</td></tr>";

     

                        CreateSectionAndItemStrBasic(dictStruc, dictPatientItem, ref str, "&nbsp;&nbsp;&nbsp;&nbsp;" + prefixstr, myBasicProtocolStruc.Id);

                    }

                }

                if (dictPatientItem.ContainsKey(parentId))

                {

                    MyPatientProtocolItem[] myPatientProtocolItemList = dictPatientItem[parentId] as MyPatientProtocolItem[];

     

                    foreach (MyPatientProtocolItem myPatientProtocolItem in myPatientProtocolItemList)

                    {

                        str += "<tr><td>" + prefixstr + myPatientProtocolItem.Content + "</td></tr>";

                    }

                }

            }

  • 相关阅读:
    Yii CGridView 之 SQL 语句
    Yii的srbac拓展中“用户已经获授权项”无法查看
    MyBatis通过注解实现映射中的嵌套语句和嵌套结果
    MyBatis一对多映射简单查询案例(嵌套结果)
    MyBatis绑定Mapper接口参数到Mapper映射文件sql语句参数
    将前端请求中的数据绑定到Spring MVC响应方法中参数的四种方法
    MyBatis一对多映射简单查询案例(嵌套Mapper映射文件中的sql语句)
    Spring MVC与html页面的交互(以传递json数据为例)
    使用Spring JDBC连接数据库(以SQL Server为例)
    spring mvc访问html页面404报错解决
  • 原文地址:https://www.cnblogs.com/quietwalk/p/2283953.html
Copyright © 2011-2022 走看看