Columns and gap

The same masonry at two to six columns. Drag the sliders. Then narrow the grid: the breakpoints follow the width of the grid, not the window, so it also works in a sidebar or a tab.