Switch layout from List To Grid in Table

HI, I would like to create button in the table header that allow for switching between list and grid view. I cannot find any references of how to do it.
Was this page helpful?