Click here to Skip to main content
15,886,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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">
Posted
Updated 17-Jan-18 17:49pm
v2
Comments
ZurdoDev 17-Jan-18 13:16pm    
This is not clear at all.

1 solution

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>
 
Share this answer
 
Comments
[no name] 18-Jan-18 1:46am    
thanks it is working fine
Karthik_Mahalingam 18-Jan-18 1:49am    
welcome,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900