table的td设置了colspan 失效

问题: td设置colspan属性无效

    <table border>
      <tbody>
        <tr>
          <td colspan="2">1</td>
          <td colspan="2">1</td>
          <td colspan="2">1</td>
          <td colspan="2">1</td>
        </tr>
        <tr>
          <td colspan="1">1</td>
          <td colspan="2">1</td>
          <td colspan="3">1</td>
          <td colspan="2">1</td>
        </tr>
      </tbody>
    </table>

 解决: 给table设置样式  table-layout: fixed;

table {
    width: 100%;
    table-layout: fixed;
    border: 1px solid #000;
    border-collapse: collapse;
}

完美解决.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ASP.NET实验报告 题目:ASP.NET效劳器控件 院系:计算机科学与工程学院 【实验题目】 ASP.NET效劳器控件 【实验目的】 1.熟悉用户控件的使用。 2.熟悉导航控件的使用。 3.掌握母版页的使用。 【实验容】 设计一个个人情况调查程序,程序启动后显示如以下图的页面。用户在填写了、选择了 性别、喜爱的歌手、居住城市、个人爱好后单击"提交〞按钮后,屏幕显示用户填写或选 择的数据信息。假设用户没填写就单击"提交〞按钮,屏幕显示出错提示信息;假设用户 没有选择"爱好〞工程,单击 "提交〞按钮, "爱好〞工程栏中显示"真可惜,你没有任何爱好!〞。 翻开Visual Studio 2021创立一个,在Default.aspx页面上进展页面的设计,此时可以切换到设计视图,也 可以使用拆分视图方便对照。 设计Web页面 Web页面中标题"个人情况调查〞为图片格式,在下面已经给出,请同学们右键单击下 面的图片,保存到本地硬盘,再在程序过ImageMap控件添加进页面。 : 设置对象属性 Web页面中需包含以下控件,Label控件、TextBox控件、Button控件、LinkButton控 件、ImageMap控件、RadioButton控件、DropDownList控件、ListItem控件、RadioButt onList控件、CheckBoxList控件等控件,并设置好每个对象的属性。开发界面如图3- 1所示。 图 3-1 程序开发界面 编写事件代码 运行和调试程序 程序最终运行界面如图3-2所示。 图 3-2 程序运行界面 【实验代码】 <%PageLanguage="C*"AutoEventWireup="true"CodeFileInherits="_Default"%> <!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN".w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns=".w3.org/1999/xhtml"> <headrunat="server"> <title>ASP.NET效劳器控件的使用</title> </head> <bodystyle="text-align: left"> <formid="form1"runat="server"> <divstyle="text-align: left"> <asp:ImageMapID="ImageMap1"runat="server"Height="100px"Width="470px" ImageUrl="~/exp-3.jpg"> </asp:ImageMap> <spanstyle="font-size: 16pt"><strong><br/> </strong></span> <tableborder="1"style="text-align: left"> <tr> <tdstyle="width: 125px"> <asp:TextBoxID="txtName"runat="server"Width="77px"></asp:TextBox></td> <tdcolspan="2"style="width: 329px; text-align: left">  性别 <asp:RadioButtonID="radSex1"runat="server"Checked="True"GroupName="seleSex"T ext="男"/> <asp:RadioButtonID="radSex2"runat="server"GroupName="seleSex"Text="女"/></td > </tr> <tr> <tdstyle="width: 125px"> 你喜爱的歌手是</td> <tdcolspan="2"style="width: 329px; text-align: left">   <asp:DropDownListID="dropSinger"runat="server"> <asp:ListItem>五月天</asp:ListItem> <asp:ListItem>宗盛</asp:ListItem> <asp:ListItem>梁静茹</asp:ListItem> <asp:ListItem>惠妹</asp:ListItem> <asp:ListItem>汪峰</asp:ListItem> </asp:DropDownList></td> </tr> <tr> <tdstyle="width: 125px"> 你家住哪里</td> <tdcolspan="2"style="w

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值