【问题标题】:How change a row height when content change?内容更改时如何更改行高?
【发布时间】:2013-03-06 18:12:18
【问题描述】:

我有一个有 4 行的 HTML 表格 行的高度是 10% 35% 45% 10% 当我将内容放在具有表格高度大小的 45% 的行中时,如果内容高度的数量很大,它会降低其他行的高度以显示内容并且所有事情都出错了我该怎么办? 是否可以只增加该行的高度? 页面大小是否增加并不重要。

<html>
<head runat="server">
    <title> Kut Sharing</title>
     </head>
<body >
<div>
    <form id="form1" runat="server">
<table width="100%"   style="height:100%" border="0">
  <tr style="height:10%;background-image:url(Photos/header.png)"" >
     <td>
    <table width="100%" style=" height:100%" border="0">
  <tr>
    <td  style="width:12%; background-image:url(Photos/header2.gif)">&nbsp;</td>
    <td>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder></td>
  </tr>
</table>
</td>
  </tr>
  <tr style="height:35%; background-image:url(Photos/bluebox.png)"">
     <td>
      <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
    </asp:ContentPlaceHolder>
      </td>
  </tr>

  <tr style="height:45%;">
    <td>
         <asp:ContentPlaceHolder  id="ContentPlaceHolder2" runat="server">

    </asp:ContentPlaceHolder>
        <br />
        <br />

    </td>

  </tr>
  <tr style="height:10%; background-image:url(Photos/footerBg.png)"">
    <td>&nbsp;</td>
  </tr>
</table>
    </form>
    </div>
</body>
</html>

【问题讨论】:

  • 为什么要在行上设置高度?让桌子自然流动不是更好吗?
  • @isherwood 因为第一行是我的标题,我想修复
  • 那为什么不在第一行的单元格上设置高度呢?

标签: html asp.net html-table


【解决方案1】:

在这种情况下,不要使用百分比来表示您的身高。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-02
    • 1970-01-01
    • 2016-05-30
    • 1970-01-01
    相关资源
    最近更新 更多