Dynamically calculate number of columns and column width. see #25