Custom grid layout for dynamically sized elements.