HTML中Table的问题
我要thead就显示一列tbody3列tfoot一列但是tbody的第一列的宽度总是跟着thead那列。。我想要thead的那列宽度和tbody3列总宽度一样但我自己在t...
我要thead就显示一列 tbody 3列 tfoot一列 但是tbody的第一列的宽度总是跟着thead那列。。我想要thead的那列宽度和tbody 3列总宽度一样 但我自己在td上定义宽度但没用。。那表就看起来很奇怪。。谁帮我解决一下<table style="width:600px; height: 318px;border:solid black 1px"><thead style="width:600px; height: 318px;border:solid black 1px“><tr><th>学习控件</th></tr></thead> <tfoot style="border:solid black 1px" > <tr> <td style="text-align:center"> <asp:Button id="btnConfirm" runat="server" Width="100px" Text="确定" /> </td> </tr> </tfoot> <tbody style="border:solid black 1px"> <tr> <td style="width:150px"><asp:Label runat="server" Width="150px" Height="20px" >用户名称:</asp:Label></td> <td style="width:300px"><asp:TextBox ID="TxtUserName" runat="server" Width="150px" Height="20px" TextMode="SingleLine" MaxLength="20" ></asp:TextBox></td> <td style="width:150px"> </td> </tr> <tr> <td style="width:150px"><asp:Label ID="Label1" runat="server" Width="150px" Height="20px" >用户口令:</asp:Label></td> <td style="width:300px"><asp:TextBox ID="txtUserPassword" runat="server" Width="150px" Height="20px" TextMode="Password" MaxLength="20" ></asp:TextBox></td> <td style="width:150px"></td> </tr> <tr> <td style="width:150px"><asp:Label ID="Label2" runat="server" Width="150px" Height="100px" >用户简历:</asp:Label></td> <td style="width:300px"><asp:TextBox ID="txtUserResume" runat="server" Width="150px" Height="100px" TextMode="MultiLine" Rows="5" MaxLength="20" ></asp:TextBox></td> <td style="width:150px"> </td> </tr> </tbody> </table>
展开
展开全部
已解决如下,其实就是table的单元格跨列,最重要的是colspan="3"在起作用:
<table cellpadding="0" cellspacing="0" style="width: 600px; height: 318px; border: solid black 1px">
<thead style="width: 600px; height: 318px; border: solid black 1px“">
<tr>
<th colspan="3">
学习控件</th>
</tr>
</thead>
<tfoot style="border: solid black 1px">
<tr>
<td style="text-align: center" colspan="3">
<asp:Button ID="btnConfirm" runat="server" Width="100px" Text="确定" />
</td>
</tr>
</tfoot>
<tbody style="border: solid black 1px">
<tr>
<td style="width: 150px">
<asp:Label ID="Label2" runat="server" Width="150px" Height="20px">用户名称:</asp:Label></td>
<td style="width: 300px">
<asp:TextBox ID="TxtUserName" runat="server" Width="150px" Height="20px" TextMode="SingleLine"
MaxLength="20"></asp:TextBox></td>
<td style="width: 150px">
</td>
</tr>
<tr>
<td style="width: 150px">
<asp:Label ID="Label3" runat="server" Width="150px" Height="20px">用户口令:</asp:Label></td>
<td style="width: 300px">
<asp:TextBox ID="txtUserPassword" runat="server" Width="150px" Height="20px" TextMode="Password"
MaxLength="20"></asp:TextBox></td>
<td style="width: 150px">
</td>
</tr>
<tr>
<td style="width: 150px">
<asp:Label ID="Label4" runat="server" Width="150px" Height="100px">用户简历:</asp:Label></td>
<td style="width: 300px">
<asp:TextBox ID="txtUserResume" runat="server" Width="150px" Height="100px" TextMode="MultiLine"
Rows="5" MaxLength="20"></asp:TextBox></td>
<td style="width: 150px">
</td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" style="width: 600px; height: 318px; border: solid black 1px">
<thead style="width: 600px; height: 318px; border: solid black 1px“">
<tr>
<th colspan="3">
学习控件</th>
</tr>
</thead>
<tfoot style="border: solid black 1px">
<tr>
<td style="text-align: center" colspan="3">
<asp:Button ID="btnConfirm" runat="server" Width="100px" Text="确定" />
</td>
</tr>
</tfoot>
<tbody style="border: solid black 1px">
<tr>
<td style="width: 150px">
<asp:Label ID="Label2" runat="server" Width="150px" Height="20px">用户名称:</asp:Label></td>
<td style="width: 300px">
<asp:TextBox ID="TxtUserName" runat="server" Width="150px" Height="20px" TextMode="SingleLine"
MaxLength="20"></asp:TextBox></td>
<td style="width: 150px">
</td>
</tr>
<tr>
<td style="width: 150px">
<asp:Label ID="Label3" runat="server" Width="150px" Height="20px">用户口令:</asp:Label></td>
<td style="width: 300px">
<asp:TextBox ID="txtUserPassword" runat="server" Width="150px" Height="20px" TextMode="Password"
MaxLength="20"></asp:TextBox></td>
<td style="width: 150px">
</td>
</tr>
<tr>
<td style="width: 150px">
<asp:Label ID="Label4" runat="server" Width="150px" Height="100px">用户简历:</asp:Label></td>
<td style="width: 300px">
<asp:TextBox ID="txtUserResume" runat="server" Width="150px" Height="100px" TextMode="MultiLine"
Rows="5" MaxLength="20"></asp:TextBox></td>
<td style="width: 150px">
</td>
</tr>
</tbody>
</table>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询