2014-10-30 82 views
1

我在面板中有一个视图控件,但似乎无法使视图控件在面板中居中。我尝试添加到所有属性样式“文本对齐:中心;显示:块;”。关于如何让这个视图集中的任何想法?如何在面板中居中视图

感谢, 克莱姆

<xp:panel style="text-align:center;display:block;" 
    id="presentationView"> 
    <xp:viewPanel rows="30" id="viewPanel1"> 
     <xp:this.facets> 
      <xp:pager partialRefresh="true" 
       layout="Previous Group Next" xp:key="headerPager" id="pager1"> 
      </xp:pager> 
     </xp:this.facets> 
     <xp:this.data> 
      <xp:dominoView var="view2" 
       viewName="PresentationStore"> 
      </xp:dominoView> 
     </xp:this.data> 
     <xp:viewColumn columnName="PresentationTitle" 
      id="viewColumn1" displayAs="link" openDocAsReadonly="true" styleClass="footer"> 

      <xp:eventHandler event="onclick" submit="true" 
       refreshMode="complete"> 
       <xp:this.action> 
        <xp:openPage name="/Comp_Presentation.xsp" 
         target="openDocument"> 
        </xp:openPage> 
       </xp:this.action> 
      </xp:eventHandler> 
     </xp:viewColumn> 
    </xp:viewPanel> 

</xp:panel> 

回答

3

您可以使用以下方法:

<xp:panel> 
    <xp:div style="display: table; margin: 0 auto"> 
     <xp:viewPanel rows="30" id="viewPanel1"> 
      <xp:this.facets> 
       <xp:pager partialRefresh="true" 
        layout="Previous Group Next" xp:key="headerPager" id="pager1"> 
       </xp:pager> 
      </xp:this.facets> 
      <xp:this.data> 
       <xp:dominoView var="view1" viewName="($All)"></xp:dominoView> 
      </xp:this.data> 
     <xp:viewColumn columnName="$106" id="viewColumn1"> 
       <xp:viewColumnHeader value="Date" 
        id="viewColumnHeader1"> 
       </xp:viewColumnHeader> 
      </xp:viewColumn> 
     </xp:viewPanel> 
     </xp:div> 
</xp:panel> 

只是用自己的代码

+0

这工作可替换的视图的数据。谢谢! – Clem 2014-10-30 17:20:41

+0

我再次需要这个,并忘记了把戏......这里真正的秘密是这条线: Clem 2018-01-31 20:42:23

0

总结DIV标签和中心是DIV标签。我通常打开我的viewPanel 80%,所以它扩展到浏览器窗口。