I have a datatable with a columnToggler, but would like to remove the fields without increasing the size of the first field. I'm using Primefaces 6.0.
<p:dataTable id="cars" var="car" value="#{dtBasicView.cars}">
<f:facet name="header">
List of Cars
<p:commandButton id="toggler" type="button" value="Columns" style="float:right" icon="ui-icon-calculator" />
<p:columnToggler datasource="cars" trigger="toggler" />
</f:facet>
<p:column headerText="Id">
<h:outputText value="#{car.id}" />
</p:column>
<p:column headerText="Year">
<h:outputText value="#{car.year}" />
</p:column>
<p:column headerText="Brand">
<h:outputText value="#{car.brand}" />
</p:column>
<p:column headerText="Color">
<h:outputText value="#{car.color}" />
</p:column>
<p:column headerText="Price">
<h:outputText value="#{car.price}">
<f:convertNumber type="currency" currencySymbol="$" />
</h:outputText>
</p:column>
</p:dataTable>