简体   繁体   中英

Clickable Table Cells, Not Rows

Is it possible using Twitter Bootstrap to make part of a row, or a certain number of cells clickable, akin to this problem, but not for the whole row?

How do I make bootstrap table rows clickable?

Do you want each cell to be clickable? You could use code similar to that in the post you linked to:

$('.table td').click(function() {
    // cell was clicked
});

This will make every 'td' element clickable. If you want just some cells to be clickable, give them a special class and then reference that in the call. For instance, give your clickable cells a "clickable" class and use the following:

$('.table td.clickable').click(function() {
    // cell was clicked
});

Granted, this sets up a separate handler for each "td.clickable", rather than one event per row, but this can easily simulate making a portion of a row clickable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM