Comment

Comment by putlake

Another problem with text rendering that's not mentioned in TFA is hyphenation. I have a table on a webpage that can have some long text in some cells. I have 2 simple requirements: # If a word will fit by moving it to the next line, then move it to the next line and do not hyphenate i.e., do not break the word. # If the word is too long to fit in a single line, then break it up. Hyphenate at will.

There is no incantation combination of CSS properties word-break, word-wrap, overflow-wrap, hyphens and white-space that will do this. In 2023.

I believe word-break: break-word does #1 but it's not hyphenating for me. And MDN says word-break: break-word is deprecated.

parent putlake 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton