Open this page in the API Guide

ReferenceGrid.fillSpace Method

for each cell, expand as much as possible to all empty space while maintaining a rectangular shape.