【问题标题】:Styling <th> in table not working in IE表格中的样式 <th> 在 IE 中不起作用
【发布时间】:2012-09-29 14:39:01
【问题描述】:

我有一个看起来像这样的表

<table>
<tr>
    <th>Heading</th>
    <td>body</td>
</tr>
<tr>
    <th>Heading</th>
    <td>body</td>
</tr>
</table>

而不是默认情况下让标题浮动。我想让它坐在上面。

这是我的代码示例 - http://jsfiddle.net/PJQT8/1/

【问题讨论】:

  • 你能给我们看看 CSS 吗?
  • 标题单元格不浮动。他们只是占据第一列。你到底想达到什么目标?
  • @BoltClock 我猜他想把它呈现在中心..

标签: html css internet-explorer html-table


【解决方案1】:

将标题单元格放在自己的行中,将数据单元格放在自己的行中。如果您不希望标题单元格占据左列,则不应将它们放在那里。

<table>
<tr>
    <th>Heading</th>
    <th>Heading</th>
</tr>
<tr>
    <td>body</td>
    <td>body</td>
</tr>
</table>

【讨论】:

    【解决方案2】:
    <table width="499" height="155" class="payment-details">
                <th width="186">Secure Payment details</th>
                  <th>Delivery Address</th>
                  <th>Billing Address</th>
                    <tr class="card">
    
                        <td width="186">
                      <p>Jane Smith</p>                  </td>
                            <td width="140">
                      <p>Jane Smith</p>                  </td>
                            <td width="157">
                      <p>Jane Smith</p>                  </td>
                    </tr>
                    <tr class="billing">
    
                        <td>
                            <p>John Smith</p>                    </td>
    
                        <td>
                            <p>John Smith</p>                    </td>
    
                        <td>
                            <p>John Smith</p>                    </td>
                    </tr>
                    <tr class="delivery">
    
                        <td>
                            <p>John Block</p>                    </td>
                             <td>
                            <p>John Block</p>                    </td>
                             <td>
                            <p>John Block</p>                    </td>
                    </tr>
                    <tr class="delivery">
                      <td>&nbsp;</td>
                       <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
    </table>
    

    【讨论】:

      猜你喜欢
      • 2011-03-15
      • 1970-01-01
      • 2011-07-11
      • 2014-06-29
      • 1970-01-01
      • 2021-11-20
      • 2019-09-17
      • 2018-02-02
      • 2013-06-29
      相关资源
      最近更新 更多