如何在ASP.NET中安排表 [英] How to arrange table in ASP.NET

查看:68
本文介绍了如何在ASP.NET中安排表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这个格式在带有单行边框的asp.net表格中





离开类型下拉列表来自日期textbox1



To Date textbox2 Reason textbox3



以上格式在html中如何使用tr和td在表中设计行边框





以下代码我尝试如下



< ; asp:Label ID =lbluserrunat =serverText =Leave Type>

< asp:DropDownList ID =ddlleavetyperunat =server>

< asp:ListItem Enabled =trueText =Select Leave TypeValue = - 1>





< asp:Label ID =lblfromdtrunat =serverText =From Date>

< asp:TextBox ID =textbox2runat =server >

< asp:Label ID =lbltodaterunat =serverText =ToDate>

< asp:TextBox ID =textbox1runat =server>

< asp:Label ID =lblreasonrunat =serverText =Reason >

< asp:TextBox ID =textbox3runat =server>



我有什么尝试过:



我希望这个格式在asp.net的表格中有单行边框





离开类型下拉列表从日期文本框1



到日期textbox2原因文本框3







以上格式在html中如何使用带有单线边框的tr和td设计表格



以下代码我尝试如下

I want this format in table in asp.net with single line border


Leave Type dropdownlist From Date textbox1

To Date textbox2 Reason textbox3

for above format in html how to design in table using tr and td with single line border


The below code i tried as follows

<asp:Label ID="lbluser" runat="server" Text="Leave Type">
<asp:DropDownList ID="ddlleavetype" runat="server">
<asp:ListItem Enabled="true" Text="Select Leave Type" Value="-1">


<asp:Label ID="lblfromdt" runat="server" Text="From Date">
<asp:TextBox ID="textbox2" runat="server">
<asp:Label ID="lbltodate" runat="server" Text="ToDate">
<asp:TextBox ID="textbox1" runat="server">
<asp:Label ID="lblreason" runat="server" Text="Reason">
<asp:TextBox ID="textbox3" runat="server">

What I have tried:

I want this format in table in asp.net with single line border


Leave Type dropdownlist From Date textbox1

To Date textbox2 Reason textbox3



for above format in html how to design in table using tr and td with single line border

The below code i tried as follows

<asp:Label ID="lbluser" runat="server" Text="Leave Type">
     <asp:DropDownList ID="ddlleavetype" runat="server">
       <asp:ListItem Enabled="true" Text="Select Leave Type" Value="-1">
          
             
   <asp:Label ID="lblfromdt" runat="server" Text="From Date">
    <asp:TextBox ID="textbox2" runat="server">
    <asp:Label ID="lbltodate" runat="server" Text="ToDate">
   <asp:TextBox ID="textbox1" runat="server">
     <asp:Label ID="lblreason" runat="server" Text="Reason">
    <asp:TextBox ID="textbox3" runat="server">

推荐答案

试试这个



try this

<div style="width:500px;"> 
            <table border="1" style="width:100%; border-collapse:collapse">
                <tr>
                    <td>
                        <asp:Label ID="lbluser" runat="server" Text="Leave Type"></asp:Label></td>
                    <td>
                        <asp:DropDownList ID="ddlleavetype" runat="server">
                            <asp:ListItem Enabled="true" Text="Select Leave Type" Value="-1"></asp:ListItem>
                        </asp:DropDownList></td>
                    <td>
                        <asp:Label ID="lblfromdt" runat="server" Text="From Date"></asp:Label></td>
                    <td>
                        <asp:TextBox ID="textbox2" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lbltodate" runat="server" Text="ToDate"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="textbox1" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblreason" runat="server" Text="Reason"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="textbox3" runat="server"></asp:TextBox>
                    </td>

                </tr>
            </table>
        </div>


这篇关于如何在ASP.NET中安排表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆