My current scenario involves creating a mobile-friendly table using HTML. I need to apply CSS in order to:
Ensure that all cells (td) do not break words, but only break at white spaces. Using
white-space: nowrap;
is not an acceptable solution.Make all columns expand in width without word breaking, breaking only at white spaces, even if it results in overflow (scrolling will be implemented).
<div style="overflow: scroll;">
<table>
<thead>
<!-- some header -->
</thead>
<tbody>
<tr>
<td>Some text</td>
<td>Some evenlongertext with words in multiple_lines</td>
<td>Some supersupersuperlong text.</td>
</tr>
<!-- etc., more rows. -->
</tbody>
</table>
</div>
EDIT 1: Here is how my table currently appears on a mobile screen: https://i.sstatic.net/65F6g.png
I want the table to expand in width to prevent any word breaking, even if it overflows horizontally.
EDIT 2: Clarification regarding word wrapping: I want the table to grow without breaking the entire string. For example, the string "Some evenlongertext with words in multiple_lines" can be displayed as:
Some
evenlongertext
with words in
multiple_lines
without breaks within individual words.
Edit 3:
It seems like the global stylesheet for my website has set word-break: break-word;
, which I cannot modify.