Display ASP.Net controls in HTML Table format with single line border

Last Reply one year ago By dharmendr

Posted one year ago

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">

but the above code it is not working

Posted one year ago

Hi narasiman,

Check the below example.

HTML

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

Screenshot