Making a Table Row clickable

前端 未结 14 1053
悲&欢浪女
悲&欢浪女 2020-12-24 12:49

I wonder what the best way to make an entire tr clickable would be?

The most common (and only?) solution seems to be using JavaScript, by using onclick=\"javascript:

14条回答
  •  不思量自难忘°
    2020-12-24 12:59

    Another approach is to actually linkify the contents of each cell. You could change the style if necessary so they don't look like traditional links.

    Note that what you are trying to do does break the intuitive user experience a little bit. It needs to be clear that clicking on a row does something. I usually prefer to put an icon at the edge of each row (a magnifying glass, etc.) which drills into a new page.

提交回复
热议问题