Unwanted Table element horizontal scrollbar

I’m curious if anyone else has run into this issue before. I’m getting an unwanted horizontal scrollbar on the table element whenever I hide a column. I’m attempting to allow a user to specify the number of columns they’d like the table to show, which required me to visibly hide columns until needed (as specified by the user). When I do so, however, the dreaded horizontal scrollbar appears.

Here’s a video explaining what I mean > https://youtu.be/wOc1UJipKXw

Here’s a video explaining the setup > https://youtu.be/1OIkeqTtHAc

I know this can be addressed via custom CSS to hide the scrollbar, but I’d prefer a better solution if possible.