Hacker News new | ask | show | jobs
by jashkenas 5265 days ago
Using a template library that allows arbitrary code will probably make this easier...

But it sounds like what you want to do is precompute all of the correct widths and heights for your elements, based on the image sizes. Then, when you go to render, you can simply look up the appropriate width, height, margin, padding for each cell.