Alignment and time columns

This is a time column with right alignment:


But notice what parts of the time string disappear when the column is narrow:


In this case I'm only interested in the minutes and seconds but I am forced to make the column wide and display a bunch of information I don't care about (the year, month, etc.).

Now I know I could make the whole column just display what I want but some of the time I will be interested in the date info and it would be silly to define a bunch of separate columns and show hide them when a single drag of column width should be sufficient to accommodate all the interesting cases.

I believe you can create a display format on the column by changing the value in 'Mapped value'. So something like this could be done:

{{ moment(self).format('HH:mm:ss') }}

And I believe only time will be displayed.

1 Like

Hi @Roland_Alden

What is your ideal solution? It sounds like you want to have a smaller width column. Could you use @Ron_West's suggestion to format everything so the time shows first & then the date? That way, users could always see the time and then hover over each cell or expand the column width to see the date if needed. Another idea that comes to mind is to use the multiline column type so that you can see the date & time in a smaller view. This might work well if the column isn't going to be editable

So the ideal solution would be to elide long strings from side opposite the alignment setting. The alignment setting is all about having the most significant data "line up" vertically. When the column is too narrow you elide the string to fit. So a good thing to check is "what end of the string is least important?" and the alignment setting tells you the answer.

Thanks so much for clarifying! That makes sense. I've submitted a feature request for this :blush:

1 Like