mastodon.me.uk is one of the many independent Mastodon servers you can use to participate in the fediverse.
Open, user-supported, corporation-free social media for the UK.

Administered by:

Server stats:

486
active users

James Smith 💾

( ideally) experts, please help me!

I'm trying to make a form in a nice tabular layout so that the first column sizes to the longest label, and all the form inputs line up in the second column.

I don't want to use bootstrap's fixed column widths, I want auto-adjustment. Can I do this? With flexbox? Should I use grid instead? Argh.

@Floppy Isn't this just the col class?

@jezhiggins col-auto sizes the columns on each row separately though, I can't get them to line up. Unless I'm missing something really dumb.

@jezhiggins layout yes, semantics no

@Floppy not an expert but what you describe sounds like it needs alignment both horizontal and vertical, which is what grid does, while flexbox is designed to work in one direction only.

@brunogirin yep, that's what I thought. Thanks :D

@Floppy aha yep that's a job for grid, I have an example to hand I can fish out when I'm back at my desk!

@mistertim ok, good to know I'm on the right track. I have a grid, just need to find how bootstrap auto-column sizing works :)

@Floppy from memory the key is grid-template-row with units specified as fr

@mistertim aha, I think I've got it - need to override bootstrap's fixed-column layout by adding "grid-template-columns: auto" to the grid container. I think.