Display / formatting of tabular data (web)
In my example, I have a table where each row is a user, eg. The columns can include their name, address, email address, etc. Now I need to add a column for (hypothetical example) my cat names. While most people will not have cats, and some people will have 1 or 2 cats, there will be a random person with 20 cats that creates one very long row in the table. This gives me a problem in the view and for filtering / searching cat names. Is there a good solution for displaying this data type?
source to share
Several parameters:
- Set max cell width and allow data transfer
- Place the content inside a wrapper tag (like a div) and set the div with a fixed width / height and overflow style: hidden to ensure that a particularly long word doesn't push out the width of the cell.
- Truncating the output text on the server side
For cases # 2 and # 3, set the Title attribute of the TD tag to contain the full text without truncation. This will show up as a tooltip when you hover over a cell.
I would mention other CSS based solutions, but they are very rarely supported right now, so not worth mentioning.
source to share