Java 是否有方法将样式应用于p:SelectMany菜单中的列?

Java 是否有方法将样式应用于p:SelectMany菜单中的列?,java,css,primefaces,Java,Css,Primefaces,是否有方法将样式应用于p:SelectMany菜单中的列 <!-- Cut down version of the code --> <p:selectManyMenu id="myMenu" value="#{myBean.myEntries}" var="ent" converter="#{EntriesConverter}" showCheckbox="true" styleClass="valign-middle mapMenu" &g

是否有方法将样式应用于p:SelectMany菜单中的列

<!-- Cut down version of the code -->
<p:selectManyMenu id="myMenu" value="#{myBean.myEntries}" 
        var="ent" converter="#{EntriesConverter}"
        showCheckbox="true" styleClass="valign-middle mapMenu" >
    <f:selectItems value="#{myBean.entryList}" var="entry" itemValue="#{entry}" />
    <p:column styleClass="css_id">#{entry.id}</p:column>
    <p:column styleClass="css_name">#{entry.name}</p:column>
</p:selectManyMenu>

#{entry.id}
#{entry.name}
生成的代码不包含css_id和css_名称,因此我看不到将css样式应用于列的好方法:(


我是遗漏了什么还是不可能?有哪些替代方案?

我找到了一种方法,以一种相当迂回的方式控制列宽:

/* MyStylesheet.css */

.mapMenu 
{
  height: 200px;
  width: inherit ! important;
}
.mapMenu table 
{
  table-layout: fixed;
}
.mapMenu table tbody tr td:nth-of-type(1) 
{
  width: 20px;
}
.mapMenu table tbody tr td:nth-of-type(2) 
{
  width: 50px;
}

这可能不是最好的方法,但在出现替代方法之前,必须这样做。

请原谅我的无知,但这段代码的来源和用途是什么,我不熟悉这种语法。在CSS for HTML中,选择器“p>p”将针对您的内部columns@Timidfriendly这就是PrimeFacesXHTML——当用户创建一个r时,它会被转换成htmlp标记不是,而是实际上表示primefaces名称空间。