I want to display a table that has columns with different widths. I want each column of the table to hide the overflow text. I have tried a multitude of things, and nothing seems to give the desired output.
For example I want something like this.
|-Row 1-|-----------Row 2------------|---------Row 3 ----------|---Row 4 ---|
|Hello..|Here is some longer text t..|You get the idea | Blah Bla...|
I have tried the following in CSS...
.ex_table { table-layout:fixed }
.ex_table tr td{ overflow:hidden; text-overflow: ellipsis; white-space:nowrap; }
.ex_table .cell_1 { width:10%; }
.ex_table .cell_2 { width:40%; }
.ex_table .cell_3 { width:30%; }
.ex_table .cell_4 { width:20%; }
But the widths get ignored (presumably because of the fixed-width?) and the table is displayed where every column is the same width.
Problem Solved
The solution above actually works, but I had table headers in my table. You need to set the width of the headers rather than the cells!