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?

0


source to share


3 answers


Let the first 50 (or any) characters in the box appear as normal, while the rest remain in the box with visibility hidden through CSS. Include a link / button / icon that will allow the user to toggle visibility so they can see the entire value.



+1


source


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.

0


source


You might want to try something like what SO does. Namely, as soon as someone reaches a certain point in his Rep, he suffixes the number and appromixates it. Ex. 10k instead of 10,236.

So the numbers don't get out of hand.

0


source







All Articles