文本框和图像按钮的对齐方式(asp.net)

时间:2015-06-19 04:07:51

标签: css asp.net alignment

这是我的UI输出 enter image description here

我可以将日期文本框和图像按钮直接对齐,就像任务名称下拉列表和添加图像按钮一样吗?

这是我的asp.net代码

<table id="fix">
                    <tr>
                        <td >
                            <asp:Label ID="lblUserName" runat="server" Text="Label" style="width:80px;"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="DropDownList1" runat="server" Width="200px" Style="width: 150px" DataSourceID="SqlDataSource1" DataTextField="USERNAME" DataValueField="USERNAME" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                                <asp:ListItem></asp:ListItem>
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SOConnectionString %>" ProviderName="<%$ ConnectionStrings:SOConnectionString.ProviderName %>" SelectCommand="SELECT USERNAME FROM USERMASTER WHERE USERSTATUS = 1 AND USERACCESSRIGHTS = 'Non-Administrator' ORDER BY USERNAME"></asp:SqlDataSource>
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>

                    <tr>
                        <td style="width: 100px;">
                            <asp:Label ID="lblDate" runat="server" Text="Label"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtDate" runat="server" CssClass="text" size="10" MaxLength="10"></asp:TextBox> 
                            <asp:ImageButton ID="ImageButton2" runat="server" Width="20px" Height="20px" ImageUrl="~/Image/calandar.jpg" OnClick="ImageButton2_Click"/><br />
                        </td>
                        <td>
                        </td>
                        <td>

                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px">
                            <asp:Label ID="lblTask" runat="server" Text="Label"></asp:Label>
                        </td>
                        <td style="width: 200px">
                            <asp:DropDownList ID="DropDownList2" runat="server" Width="150" Style="width: 150px" DataSourceID="SqlDataSource2" DataTextField="TASKNAME" DataValueField="TASKNAME">
                                <asp:ListItem></asp:ListItem>
                            </asp:DropDownList>
                            <asp:ImageButton ID="ImageButton1" runat="server" CssClass="imagebutton" ImageUrl="~/Image/add-icon.png" OnClick="ImageButton1_Click" Style="position: absolute; height: 20px; width: 20px;" />
                            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:SOConnectionString %>" ProviderName="<%$ ConnectionStrings:SOConnectionString.ProviderName %>" SelectCommand="SELECT DISTINCT TASKNAME FROM TASKMASTER WHERE TASKSTATUS='1'"></asp:SqlDataSource>
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>

                </table> 

您的评论和建议非常适用!感谢

0 个答案:

没有答案