Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Well then take a look at the source code https://github.com/desandro/masonry and build it buy yourself.
Do you know the width/height of your images ? If so you can use https://github.com/Spope/MiniMasonry.js Look for the codepen link in the examples.
There's an implementation from Google in this CSS Houdini samples repo: https://github.com/GoogleChromeLabs/houdini-samples/tree/master/layout-worklet/masonry
Use a library, there are many small issues with these renders and doing them right will make it look much better. My favorite is the pro-gallery https://github.com/wix/pro-gallery/ Disclaimer, I wrote it :)
Related posts
- Any idea how to make this layout using grid or layout? My code in the comments
- Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout – WebKit
- Tabulator – JavaScript Tables and Data Grids
- Tabulator: Tables, datagrids and tree grids for Vanilla JavaScript
- Tabulator: Interactive Data Grid for JavaScript (No React, No Vue)