Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

How-to

How to make rows and columns that rearrange themselves

Flexible containers in Layout by Zaweba lay out a group's frames in a row or column, with gaps, padding and alignment, and re-run after every change.

How to make rows and columns that rearrange themselves

Flexible containers are the answer in Layout by Zaweba. Choose Object > Flexible layout and a frame lays out the other frames in its group as a row or a column, with gaps between them, padding around them, and rules for how they spread out and line up. The layout runs again after every change, so adding, removing or resizing an item rearranges the rest automatically.

Anyone who has built a row of product boxes and then been asked to add one more knows the problem. Every box has to be nudged across, the spacing recalculated, the alignment checked again. A flexible container does that work for you.

How a flexible container behaves

A flexible container is a frame that controls the others in its group. You choose a row or a column, and whether it's reversed. You can let items wrap onto a new line when they run out of room, which turns a row into a neat grid.

Gaps set the space between items. Padding sets the space between the items and the container's edge. Distribution decides how items spread along the line: from the start, the centre or the end, or with space between, around or evenly. Alignment decides how they sit across the line: start, centre, end or stretch, where stretch makes them all fill the full height of a row or width of a column.

Items run in the order they sit in the group. Containers can be nested, so a column of rows, or a row of columns, is possible.

Building one, step by step

Draw the frames you want arranged, such as several picture frames with captions, and group them with a frame that will act as the container. Select the group and choose Object > Flexible layout. Pick row or column, then set the gap and padding. Try the distribution and alignment options and watch the items move.

Now change something. Resize one picture, delete a frame, or add a new one to the group. The container rearranges straight away. That's the real test that it's set up as you want.

Where containers save the most time

Product grids in catalogues, where the number of items per page varies. Rows of sponsor logos that need even spacing however many sponsors there are. Team pages with a photo and name for each person. Navigation buttons along the bottom of an interactive PDF. Price cards on a menu.

Nested containers handle more complex blocks. A product card can be a column (picture, name, price) and the cards sit in a wrapping row, so the whole page reflows when a product is added.

Keeping containers easy to manage

Decide the order first. Because items follow the order they sit in the group, getting the order right saves dragging things about later.

Use consistent frame sizes when you want a regular grid, and let stretch do the work when frames should share a height. Use padding rather than nudging individual items away from the edge.

Don't put everything in containers. Flexible layout is best for repeating items. A one off feature spread with carefully placed pictures is better arranged by hand with smart guides and the Align panel.

How it fits with other tools

Flexible containers sit alongside Layout's other layout aids: column guides, Create guides for rows and columns fitted to the page or margins, step and repeat for grids of copies, and align and distribute for one off spacing. For catalogues built from spreadsheet data, Create catalogue can filter, sort and group records into columns down the pages, and flexible containers can tidy the blocks it produces.

With flexible containers, a layout in Layout by Zaweba stays orderly as its content changes, and the late extra product is a minute's job, not an afternoon's.