UITableCell alignment isn't working?

Hi,

I’m not sure if I’m doing something wrong, but I can’t get UITableCell alignment to work. I’ve tried it two ways, and neither seem to change the display at all.

let header = UITableRow()
header.isHeader = true

parkHeaderCell = UITableCell.text("Park")
parkHeaderCell.centerAligned()
parkHeaderCell.widthWeight = 50
header.addCell(parkHeaderCell)

hoursHeaderCell = UITableCell.text("Hours")
hoursHeaderCell.centerAligned()
hoursHeaderCell.widthWeight = 50
header.addCell(hoursHeaderCell)

I’ve also tried it like:

let row = new UITableRow()

let title = item.title
let titleCell = row.addText(title)
titleCell.centerAligned()
titleCell.widthWeight = 70

let desc = item.description
let descCell = row.addText(desc)
descCell.rightAligned()
descCell.widthWeight = 30

table.addRow(row)

Is there something apparent that I’m doing wrong here?

Thanks for any help! :blush:

I’m having the same issue. I’ve tried exactly what you’ve tried and can’t seem to figure out what’s wrong. I tried changing the cellSpacing property of the UITableRow and that is working. Seems like the alignment methods aren’t functioning correctly.

This is my bad :flushed: There is a bug with alignment in the current version of Scriptable. I’ve fixed the issue. The fix will be included in the next update.

1 Like

No worries. Just wanted to see if I was doing something wrong. Thanks!