Help

Extra spaces between empty values when columns set to other than short

1719 1
cancel
Showing results for 
Search instead for 
Did you mean: 
AL1S
5 - Automation Enthusiast
5 - Automation Enthusiast

Just a minor inconsistency here. I’m not sure which is supposed to be the “right” one.

I have this function, which has some values that are empty in it (no subtype is set for these records).

Screen Shot 2018-10-13 at 1.29.58 AM.png

Despite the extra space after the empty value, they look alright…but only in “short” view.

45%20AM

In taller views the spaces appear, looking rather icky.

27%20AM

I suppose technically they should have double spaces, as in the function? (Although that leaves me with no way to make an attractive title.) Either way, it’s odd that it behaves differently on different views and it didn’t look like anyone had mentioned it so far, so I thought I would :slightly_smiling_face:

1 Reply 1

With ‘short’ row-height, Airtable sets the CSS white-space property to ‘nowrap’. This causes sequences of white-space characters to collapse to a single space. (This is also why embedded newlines appear as a space rather than as a line-break.)

For other row heights, white-space is set to ‘pre’. This preserves embedded space characters and wraps at line breaks. Sequential space characters are treated as multipler spaces, and embedded newlines (’\n’) cause a line break.

To ensure a single space between values, change your formula to

Size&IF(
    Subtype,
    ' '&Subtype
    )&IF(
        Format,
        ' '&Format
        )

Edit: I should note I didn’t actually check how Airtable sets the CSS property before posting this. I’ve done so in the past, and these are the most likely values, based on performance. That said, Airtable is an extremely complex web app, and it may use other methods to achieve similar outcomes.