I am trying to create a table where each column fits the width of the content (just like a normal table), but when the content would push the table beyond 100% of the container width, certain long columns would be truncated with an ellipsis.
+-------------+------------+------+
|some content | short text | more |
+-------------+------------+------+
+-------------+------------------------------------------------+------+
|some content | much longer text that forces the table wide... | more |
+-------------+------------------------------------------------+------+
It appears that any use of text-overflow: ellipsis requires a fixed-width table, and perhaps fixed-width columns. This is unfortunate because columns will no longer adjust their widths to fit content automatically.
I'm not tied to using a <table>. I've also attempted to do it using Bootstrap's col-auto. col-auto adjusts the width of the column to the content, but like <table> it refuses to truncate text when the table gets too wide.
Is this even possible?
Here's a fiddle: https://jsfiddle.net/nsf04tce/2/