Tables in Writer work the other way round.
When you insert a table you reserve some space out of the page. This space is divided into columns (you chose their number when creating the table). Then text is added into the cells and line wrapping occurs when text reached the cell boundary. The only “dynamic” factor is the vertical axis: lines are allocated to hold the text, increasing cell size and eventually spilling over on next page in a copy of the table with same properties.
You want to match text content. But what is the size of text? In ordinary paragraphs (outside tables), margins define the horizontal size inside which text is formatted. Margins don’t adapt to a partially filled line. And what would that mean for a multi-line paragraph? On which general criterion would Writer to decide to format your paragraph as an 8-line para instead of a 5-line para. Only you can do that, intentionally modifying paragraph indents (that’s the name for the additional “margins” between page margins and paragraph limits).
The first task is to decide for a total table width.
By default, tables use the full page width between margins. If you don’t like it, put the cursor in the table and
Table tab, choose any Alignment other than Automatic. You can then force a width and optionally offset the table if it is not flushed left or right or centred. Columns width are manually set in the
But, according to your question, you don’t want to go for the manual procedure.
Select the group of contiguous columns you want to adapt. Then press on the table toolbar button. The narrow icon will shrink the sparser columns to minimum, the fat icon will distribute uniformly and the remaining icon (with double arrow) will do something in-between, so called “optimal”.
What you probably missed was first to select a group of cells.
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!
In case you need clarification, edit your question (not an answer) or comment the relevant answer.