Search code examples
csscss-tables

CSS select only one item from table


Is there a way to disable multi-selection from a table in CSS? I have a table, and the user can select multiple items but I want it to restrict it to one item, is there a way to do that through CSS?


Solution

  • Short answer: there was possibly going to be a way, but no, there isn't.

    Long answer: one of the proposed values for user-select was element. If the property made (or makes...) it into CSS3, I think that'd be the style you'd use. No browser implements it per the proposal though, since it was nothing beyond an idea. Vendor implementations usually only have all, text and none to choose from, but not element or elements.