Dynamically obtains max length of columns