【问题标题】:Gridview lines get the same line height as the height of the lines of the parent tableGridview 行的行高与父表行的高度相同
【发布时间】:2013-01-18 21:50:11
【问题描述】:

我有一个 3 列 15 行的表格。我给表格的行指定了 30px 的行高。第三列跨越所有行,里面是一个 div,里面是我的 asp.net gridview。在浏览器上渲染时,gridview 的行也设置为 30px。防止这种情况的最佳方法是什么,以便 gridview 线具有默认线高?这是 CSS 和 html:

.tr-info {line-height:30px}     

<table>
  <tr class="tr-info">
    <td>
    </td>
    <td>
    </td>
    <td rowspan="15">
      <div>
        <asp:GridView runat="server" ID="gvPersonalInfo"></asp>
      </div>
    </td>
  </tr>
  <tr class="tr-info">
    <td>
    </td>
    <td>
    </td>
  </tr>
  <!-- And so on with 13 more rows -->
<table>

【问题讨论】:

    标签: asp.net tablerow


    【解决方案1】:

    为GridView 的RowStyle 和AlternateRowStyle 样式设置适当的CssClass:

    .smallRow {
      height: 15px;
    }
    
    
    <rowstyle CssClass="smallRow" />
    <alternatingrowstyle CssClass="smallRow" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-02
      • 2020-06-20
      • 1970-01-01
      • 2018-12-07
      • 1970-01-01
      • 2021-11-11
      • 1970-01-01
      相关资源
      最近更新 更多