我正在用ASP.net製作我的第一個網站,並且在格式化表格的標記時遇到了一些麻煩。我希望能夠讓用戶填寫問卷。這是一個多部分的調查問卷,所以我使用手風琴來節省空間。第一個窗格中的一個問題有五個部分的答案。我的桌子給了我一些意想不到的行爲。大約一半的時候,我嘗試在五個文本框上方顯示五個標籤。我將這些插入表格中的適當位置,但出於某種原因,它們出現在頁面的底部。我無法確定發生了什麼事。有任何想法嗎?提前致謝。ASP.Net中的表格<tr>
<%@ Page Title="About Us" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Questionnaire.aspx.cs" Inherits="About" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<style type="text/css">
.accordion
{
width: 950px;
}
.accordionHeader
{
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}
.accordionHeaderSelected
{
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}
.accordionContent
{
background-color: #D3DEEF;
border: 1px dashed #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 10px;
}
.style1
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Questionnaire
</h2>
<p>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</p>
<p>
</p>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Accordion ID="Accordion1" CssClass="accordion" HeaderCssClass="accordionHeader"
HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent"
runat="server" Height="100px" Width="950px">
<Panes>
<asp:AccordionPane ID="AccordionPane2" runat="server">
<Header>
General Business & Project Question</Header>
<Content>
<table class="style1">
<tr>
<asp:Label ID="lblQid2_1" runat="server"></asp:Label>
<asp:Label ID="lblQ2_1" runat="server"></asp:Label>
</tr>
<tr>
<asp:TextBox ID="txtQ2_1" runat="server"></asp:TextBox></tr>
<tr>
<asp:Label ID="lblQid2_2" runat="server"></asp:Label>
<asp:Label ID="lblQ2_2" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_2" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_3" runat="server"></asp:Label>
<asp:Label ID="lblQ2_3" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_3" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_4" runat="server"></asp:Label>
<asp:Label ID="lblQ2_4" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_4" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_5" runat="server"></asp:Label>
<asp:Label ID="lblQ2_5" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_5" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_5_1" runat="server"></asp:Label>
<asp:Label ID="lblQ2_5_1" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_5_1" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_5_2" runat="server"></asp:Label>
<asp:Label ID="lblQ2_5_2" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_5_2" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_5_3" runat="server"></asp:Label>
<asp:Label ID="lblQ2_5_3" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_5_3" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_6" runat="server"></asp:Label>
<asp:Label ID="lblQ2_6" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_6" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_7" runat="server"></asp:Label>
<asp:Label ID="lblQ2_7" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_7" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_8" runat="server"></asp:Label>
<asp:Label ID="lblQ2_8" runat="server"></asp:Label></tr>
<tr>
<td>
<asp:Label ID="Label1" Text="test" runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Label2" runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Label3" runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Label4" runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Label5" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="txtQ2_8" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<asp:Label ID="lblQid2_9" runat="server"></asp:Label>
<asp:Label ID="lblQ2_9" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txt2_9" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_10" runat="server"></asp:Label>
<asp:Label ID="lblQ2_10" runat="server"></asp:Label></tr>
<tr>
<asp:TextBox ID="txtQ2_10" runat="server"></asp:TextBox>
</tr>
<tr>
<asp:Label ID="lblQid2_11" runat="server"></asp:Label>
<asp:Label ID="lblQ2_11" runat="server"></asp:Label></tr>
<tr>
<asp:RadioButton ID="rboQ2_11y" Text="Yes" runat="server" AutoPostBack="True" GroupName="a"
OnCheckedChanged="rboQ2_11y_CheckedChanged" />
<asp:RadioButton ID="rboQ2_11n" Text="No" runat="server" AutoPostBack="True" GroupName="a"
OnCheckedChanged="rboQ2_11n_CheckedChanged" /></tr>
<tr>
<asp:Label ID="lblQid2_11_1" runat="server"></asp:Label>
<asp:TextBox ID="txtQ2_11_1" runat="server"></asp:TextBox>
</tr>
</table>
</Content>
</asp:AccordionPane>
<asp:AccordionPane ID="AccordionPane3" runat="server">
<Header>
Solution Architecture & Technical Questions</Header>
<Content>
<table class="style1">
<tr>
<asp:CheckBox ID="chb_1" runat="server" Text="Testing" /></tr>
</table>
</Content>
</asp:AccordionPane>
</Panes>
</asp:Accordion>
</ContentTemplate>
</asp:UpdatePanel>
<p>
<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
<asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</p>
<p>
</asp:Content>