My challenge involves modifying a table on Sharepoint with responsive design in mind. The goal is to hide the last visible column in the table based on the screen's width.
For instance, if a user creates a 10-column table and the screen size is 1200px, the last 5 columns should disappear when the window is resized to 600px. Similarly, when the window is resized to 800px, the last 3 columns should be hidden.
Currently, I am able to hide columns using CSS with display:none on the :nth-child selector. However, this method does not check if the column is already hidden to move to the n-1 child.
Is there a CSS solution for this issue, or would it require Javascript? If Javascript is necessary, how can this be achieved?
Your help is appreciated. Thank you.