@Szarpul's answer works fine. I extended it so that you can have columns with fixed with, columns that adjust its width and a column that takes up the remainder.
For fixed width set the width attribute to the desired width. For flexible width set it to any value greater than 0. If the width of the content is longer it will grow to the width of the longest element. The styling prevents that text will be wrapped at each space. For a column that takes up the remaining space do not define the width. You can even use more columns without a width, they will then split up the remaining space equally.
Here is an example:
<p:dataTable tableStyle="table-layout: auto;">
<p:column width="300" headerText="Text" />
<p:column width="300" headerText="Some more Text" />
<p:column width="1" headerText="Text" style="white-space: nowrap;"/>
<p:column width="1" headerText="Some more Text" style="white-space: nowrap;"/>
<p:column headerText="Remainder" />
</p:dataTable>
This will look like this:
-----------------------------------------------------------------------------------------
| Text | Some more Text | Text | Some more Text | Remainder |
-----------------------------------------------------------------------------------------
This works for <p:treeTable>
as well. I tested this solution for both components on Chrome 84 and IE 11.