Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
- </head>
- <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
- <body>
- <div class="col-md-2"></div>
- <div class="col-md-7">
- <div class="table-responsive">
- <table id="tableSelect" class="table rowclick table-hover">
- <thead>
- <tr>
- <th scope="col"> Select</th>
- <th>Text</th>
- <th>Comment</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th scope="col">
- <input type="radio" name="radios" id="radio1" />
- </th>
- <th scope="col">text1</th>
- <td>comment1</td>
- </tr>
- <tr>
- <th scope="col">
- <input type="radio" name="radios" id="radio2" />
- </th>
- <td>text2</td>
- <td>comment2</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <script>
- $('#tableSelect tr').click(function() {
- $(this).find('th input:radio').prop('checked',true);
- })
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement