简体   繁体   English

如何删除Richfaces自动面板宽度100%

[英]How can I remove Richfaces automatic panel width of 100%

I have an extendedDataTable inside of a Panel (I also tried just sticking it in a div). 我在Panel内部有一个ExtendedDataTable(我也尝试过将其粘贴在div中)。 The width of the table extends to fill the parent instead of the parent shrinking to the content. 该表的宽度扩展为填充父对象,而不是缩小为内容。

code for the table 表格代码

<h:body>
<ui:composition template="../main_template.xhtml">
    <ui:define name="content">
        <h:form>
            <div class="table_panel">
                <rich:extendedDataTable value="#{user_list.userList}" var="user" filterVar="filterValue" id="table"
                                        sortPriority="#{userListSortingBean.sortPriorities}"
                                        selectionMode="none"
                                        rowClasses="odd_row, even_row">
                    <rich:column sortBy="#{user.nameFirst}" filterExpression="#{empty filterValue or fn:startsWith(user.nameFirst, filterValue)}">
                        <f:facet name="header">First Name</f:facet>
                        <h:outputText value="#{user.nameFirst}" />
                    </rich:column>
                    <rich:column sortBy="#{user.nameLast}" filterExpression="#{empty filterValue or fn:startsWith(user.nameLast, filterValue)}">
                        <f:facet name="header">Last Name</f:facet>
                        <h:outputText value="#{user.nameLast}" />
                    </rich:column>
                    <rich:column sortBy="#{user.email}" filterExpression="#{empty filterValue or fn:startsWith(user.email, filterValue)}">
                        <f:facet name="header">Email</f:facet>
                        <h:outputText value="#{user.email}" />
                    </rich:column>
                    <rich:column sortBy="#{user.company.name}" filterExpression="#{empty filterValue or fn:startsWith(user.company.name, filterValue)}">
                        <f:facet name="header">Company</f:facet>
                        <h:outputText value="#{user.company.name}" />
                    </rich:column>
                    <rich:column sortBy="#{user.company.activeFlag}" filterExpression="#{empty filterValue or fn:startsWith(user.company.activeFlag, filterValue)}">
                        <f:facet name="header">Company Active Status</f:facet>
                        <h:outputText value="#{user.company.activeFlag}" />
                    </rich:column>
                    <rich:column sortBy="#{user.company.expirationDate}" filterExpression="#{empty filterValue or fn:startsWith(user.company.expirationDate, filterValue)}">
                        <f:facet name="header">Expiration Date</f:facet>
                        <h:outputText value="#{user.company.expirationDate}" />
                    </rich:column>
                </rich:extendedDataTable>
                <rich:messages />
            </div>
        </h:form>
    </ui:define>
</ui:composition>

relevant css 相关的CSS

#main_content .table_panel {

background-color: #BED6F8;
color: #0066cc;
border-width: 3px;
}

#main_content .rf-edt {
border: none;
}

#main_content .rf-edt-ftr {
border: none;
}

.even_row {
background-color: #ECF3FE;
}

.odd_row {
background-color: #FCFFFE;
}

and I intended to post a picture of the result, but don't have the reputation for it. 我打算发布一张有关结果的图片,但没有声誉。 What is going on Is my wrapper div is being filled by the table even though the data in the table only needs about 50% of the space. 发生什么了,即使表中的数据仅需要约50%的空间,我的包装div仍被表填充。 I just need the table to shrink down to it's contents. 我只需要表格缩小到它的内容。

Just for information's sake. 只是为了提供信息。 As of richfaces 4.3.3 this is just how the column widths work. 从Richfaces 4.3.3开始,这就是列宽的工作方式。 We ended up making the table just a bit smaller than the sum of all the columns and accepting the bottom scroll bar. 我们最终使表格略小于所有列的总和,并接受底部滚动条。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM