2014-03-05 58 views
1

我有下面的代码,有时我的网页不能正确渲染:元素TD没有明确关闭

<div id="logout" style="text-align:right;"> 
     <h:panelGrid columns="2"> 
      <h3> 
       <h:outputText value="Hello #{myBean.usr.name} #{myBean.usr.surname}" style="color:black;"/> 
      </h3> 
      <p:commandLink action="#{myBean.quit}" immediate="true"> 
       <h:outputText value="Quit"/> 
      </p:commandLink> 
     </h:panelGrid> 
</div> 

我有一个警告:

WARNING: HTML nesting warning on closing h3: element td rendered by component : [...] not explicitly closed

我知道这只是一个警告,但我想解决这个问题,以确保这不是不良显示的原因。

+0

我发现了一个溶液中除去panelGrid'的''columns'特性并除去'h3'标签。 – JGeo

回答

0

您可以使用CSS类删除<h3>标记并设置<h:outputText>的样式。或者尝试附上<h:panelGroup>中的部分。

<h:panelGrid columns="2"> 
    <h:panelGroup> 
     <h3> 
      <h:outputText value="Hello #{myBean.usr.name} #{myBean.usr.surname}" /> 
     </h3> 
    </h:panelGroup> 

    <p:commandLink action="#{myBean.quit}" immediate="true"> 
     <h:outputText value="Quit"/> 
    </p:commandLink> 

</h:panelGrid> 

Laying Out Components with the h:panelGrid and h:panelGroup Tags

+0

试过但不改变任何东西!谢谢。 – JGeo