Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

I'm designing an application with a data table. The data is backed by a C-style string (that is to say, a char array) so I know the maximum theoretical width using my proportionally-spaced typeface.

For example, assume that a string's length can't be greater than 32 characters. Naively, I can say that since "W" is the widest character, the maximum theoretical column width is 32 times the width of "W". But this will pretty much never happen, and if I make my column as wide as 32 "W"'s there'll be a lot of wasted space on average. On the other hand, it's not the end of the world if a string runs long and is truncated; I just want the vast majority of strings to be represented in their entirety.

Is there a back-of-the-envelope calculation for estimating the ideal default column width?

share|improve this question
    
Simply use an existing table that adjusts its column widths depending on what the width of the widest item is in each column. –  AndroidHustle Dec 5 '12 at 18:46
    
@AndroidHustle: The table is virtualized and can have over 100,000 items. Unfortunately that's not an option in this case. –  Tenner Dec 5 '12 at 18:52
1  
This question appears to be off-topic because it is about a calculation that would be better suited on stackoverflow.com. –  Code Maverick Feb 27 at 21:40
add comment

1 Answer 1

up vote 1 down vote accepted

If (as you say) truncation is acceptable, then the question is more about:

  • what you expect the column width do be most of the time
  • what other columns also have to fit next to it
  • how wide the expected screen resolution will be
  • how much can be truncated without being a problem

These are all things that require a subjective evaluation, which you have to make and then test.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.