【问题标题】:Text on the Button with space in between disappears in IE按钮上带有空格的文本在 IE 中消失
【发布时间】:2011-01-20 09:49:46
【问题描述】:

我有一些 6 个按钮要显示在工具栏中,并且这些按钮必须以这样一种方式显示,即有一个分组,即 3 个按钮后跟一点空间,然后再显示另外 3 个按钮。我使用 JSF 作为 UI 框架。

问题在于,当我在第一组中的最后一个按钮必须显示中间有空格的文本时,即“单击此处”,仅显示单击

其实我用table html标签来分组按钮集

<table>
    <tr>
        <td>
            <%-- 1st 3 buttons --%>
            <%-- the last button here has the text "Click here", But only Click is displayed in UI --%>
       </td>
       <td></td>
       <td></td>
       <%-- This is used to get the gap between group of buttons and this is what is causing the issue --%>
       <td>
           <%-- Another 3 buttons --%>
       </td>
    </tr>
</table>

其中一个按钮的代码(所有其他按钮的呈现方式类似)

<hx:jspPanel id="b1" rendered="true">
    <p:outputButtonLink id="b11" rendered="true"  
        value="Click Here"
        iconSrc="../../images/click1.gif"
        href="#" onclick="return Show();">
    </p:outputButtonLink>
</hx:jspPanel>

【问题讨论】:

  • 请同时发布发出按钮的代码
  • 也给出生成的 HTML。 p: 是什么? Primefaces?

标签: html jsp jsf button internet-explorer


【解决方案1】:

IE 不会呈现“空”表格单元格。把&amp;nbsp;放进去,让IE渲染出来。

<td>&nbsp;</td>

也就是说,我强烈建议您进一步了解CSS。使用margin 可以轻松解决此问题。

【讨论】:

  • 感谢您的回复,但很有效。我发现让表格本身对按钮进行分组会导致问题。
  • 非常感谢,我可以通过设置 css 属性 width:100% for td 来修复它
猜你喜欢
  • 2017-09-04
  • 1970-01-01
  • 2013-07-04
  • 2010-11-03
  • 2015-02-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-06
相关资源
最近更新 更多