html - IE 9 表格间距问题

标签 html css internet-explorer

问题是出于某种原因,当在 IE 9(非兼容模式)中时,其中一个 tds 会导致愚蠢的对齐。在这个 fiddle 中 http://jsfiddle.net/2x3k3y5e/1/左侧按钮很好,它是右侧按钮中的第一个。由于某种原因,它不会设置在右侧。这是用户控件(按钮栏)的一部分,它将为页面创建各种按钮。只有在 IE 9 中我们才注意到这个问题。我想在所有地方修复它,并希望为此使用一些 css。

<table style="margin-top:10px;" cellspacing="0" cellPadding="0">
<tbody>
    <tr>
        <td noWrap="nowrap">&nbsp;&nbsp;</td>
        <td style="width: 100%;">
            <input style="width: 125px;" id="BottomButtonBar_btnDelete" class="btnEntry"  name="m$c$PatientSearchUC$PanelSearch$PanelSearch_BBB$BottomButtonBar_btnDelete" value="Previous Criteria" type="button"/>
        </td>
        <td style="padding-left: 4px;">
            <input style="font-weight: normal; " id="BottomButtonBar_btnUpdate" class="btnEntry"  value="Clear" type="button"/>
        </td>
        <td style="padding-left: 4px;">
            <input style="width: 65px; font-weight: bold;" id="BottomButtonBar_btnUpdateAndReturn" class="btnPrimary btnEntry" value="Search" type="submit"/>
        </td>
    </tr>
</tbody>
</table>

CSS:

    .btnEntry, .btnNav, .btnPrimary, .btnDefault{
  text-transform: none;
  cursor: pointer;  
  padding-right: 0;
  padding: 6px 12px;
  margin-left:0;
  margin-right:0; 
  color: #000000;
  min-width:60px;
  }

.btnNav {
  background-color: #fff;
  border: #ccc 1px solid;
}

.btnEntry {
  background-color: #ccc;
  /*border: #b2b2b2 1px solid;*/
   border: #ababab 1px solid;
    color: #404040;  
    min-width:60px;
}
.btnDefault {
    background-color: #ccc;
    border: #ababab 1px solid;
    color: #404040;
}
.btnPrimary {
  color: #ffffff;
  background-color: #82a83d;
}

如果我设置大小它很好,但我不认为使用 jquery 将按钮的大小重置为相同大小是一个好的解决方案。我再次希望有一些我不知道的 css 技巧可以解决这个问题。谢谢。

旁注:我使用 IETester 或带有 Windows 和 IE 9 的虚拟机

最佳答案

尝试 float :向右:

HTML:

<table style="margin-top:10px;" cellspacing="0" cellPadding="0">
    <tbody>
        <tr>
            <td noWrap="nowrap">&nbsp;&nbsp;</td>
            <td style="width: 100%;">
                <input style="width: 125px;" id="BottomButtonBar_btnDelete" class="btnEntry"  name="m$c$PatientSearchUC$PanelSearch$PanelSearch_BBB$BottomButtonBar_btnDelete" value="Previous Criteria" type="button"/>
            </td>
            <td style="padding-left: 4px;">
                <input style="font-weight: normal; " id="BottomButtonBar_btnUpdate" class="btnEntry btnClear"  value="Clear" type="button"/>
            </td>
            <td style="padding-left: 4px;">
                <input style="width: 65px; font-weight: bold;" id="BottomButtonBar_btnUpdateAndReturn" class="btnPrimary btnEntry" value="Search" type="submit"/>
            </td>
        </tr>
    </tbody>
</table>

CSS:

.btnEntry, .btnNav, .btnPrimary, .btnDefault{
  text-transform: none;
  cursor: pointer;  
  padding-right: 0;
  padding: 6px 12px;
  margin-left:0;
  margin-right:0; 
  color: #000000;
  min-width:60px;
  }
.btnClear{
    float:right;
}
.btnNav {
  background-color: #fff;
  border: #ccc 1px solid;
}
.btnEntry {
  background-color: #ccc;
  /*border: #b2b2b2 1px solid;*/
   border: #ababab 1px solid;
    color: #404040;  
    min-width:60px;
}
.btnDefault {
    background-color: #ccc;
    border: #ababab 1px solid;
    color: #404040;
}
.btnPrimary {
  color: #ffffff;
  background-color: #82a83d;
}

关于html - IE 9 表格间距问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25407542/

相关文章:

jquery - 如何使用 jQuery.support 检测 IE7 和 IE8

jquery - 破坏 DataTable 时 IE 错误

CSS - div 不填充 chrome 或 ie 中其他两个 div 之间的空间

javascript - 我们如何将浮点值输入类型传递到另一个页面进行检索

jquery css 在不同背景的部分之间平滑滚动

javascript - 相同的图像以秒为间隔随机出现在 3 个不同的 div 中

javascript - 如何在 Internet Explorer 8 中禁用缓存

html - 没有换行符的多个文本标签

html - 如何获得特定元素的第一个 child ?

html - @font-face - 为一种字体使用多个文件