Vertical Alignment in datagrid


#1

Hi, is there a way to set vertical alignment (top, middle, bottom) in datagrid? I see horizontal alignment but not sure how to do vertical alignment.

thanks


#2

Hi @liuyue,
Adding a line return before or after your text will move it to the top or bottom of the cell.

Top: add \r after the text.

Bottom: add \r before the text.

Middle: this is the default.

Give it a try and let me know if that works for you :slight_smile:


#3

I guess this sort of works (1 , , ,\r \r \r ), allowing me to center the 1 in a triple row. I see what you are saying but it’s clumsy…

Thanks!


#4

Actually it doesn’t seem to work. For a single row (6 /r, , , ,), this is not aligning the 6 to top.


#5

Took me a while to notice, but in your single row example, the line return uses a forward slash (/r) instead of a backslash (\r). When I use \r in a single row it did align the 6 to the top. Let me know if that works for you.

I agree this is a clumsy workaround. I’ll check with the team about adding a feature request for a better solution.

Thanks for helping us improve!


#6

Thanks phil for catching the typo. again, this sort of works but doesn’t move the text up far enough to be called top aligned. would be great to see a real vertical alignment feature which is a common function for any application deals with text formating.