【问题标题】:Table is realigned after setting the display property to 'block'将显示属性设置为“块”后重新对齐表格
【发布时间】:2010-04-16 15:50:24
【问题描述】:

我有一张桌子,我有一行最初设置为“无”的显示属性

并且我在我的选择框中选择了一些值时将其更改为“阻止”,此时该行未正确对齐。我的两列设置在上述行的一列中?

但是当我再次将其更改为“无”时,所有其他行都正确对齐..

【问题讨论】:

  • 你能提供一些示例代码吗?

标签: javascript html css


【解决方案1】:

不要将其更改为display:block;,而是使用display:table-row;

Example here.

代码:

<table width="200" border="1">

  <tr style="display:table-row;">
    <td><span class="A">8:00 AM</span></td>
    <td><span class="B">Monday</span></td>
    <td><span class="C">Sept</span></td>
  </tr>

</table>​

【讨论】:

  • 这个属性很好用。我很久以前学习的时候试过了。必须记住那些事情...... :)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-01-03
  • 1970-01-01
  • 2010-09-09
  • 2015-12-01
相关资源
最近更新 更多