Advertisement
Guest User

HTML Table: Highlight & Radio Button

a guest
Jun 6th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.06 KB | None | 0 0
  1. <html>
  2.     <head>
  3.         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  4.     </head>
  5. <script src="jquery-1.12.2.min.js">
  6.     $('#tableSelect tr').click(function() {
  7.         $(this).find('th input:radio').prop('checked',true);
  8. })
  9. </script>
  10.  
  11. <body>
  12.  <div class="col-md-2"></div>
  13.   <div class="col-md-7">
  14.         <div class="table-responsive">
  15.    
  16.           <table id="tableSelect" class="table rowclick table-hover">
  17.             <thead>
  18.               <tr>
  19.                 <th scope="col"> Select</th>
  20.                 <th>Text</th>
  21.                 <th>Comment</th>
  22.               </tr>
  23.             </thead>
  24.             <tbody>
  25.               <tr>
  26.                 <th scope="col">
  27.                   <input type="radio" name="radios" id="radio1" />
  28.                 </th>
  29.                 <th scope="col">text1</th>
  30.                 <td>comment1</td>
  31.               </tr>
  32.               <tr>
  33.                 <th scope="col">
  34.                   <input type="radio" name="radios" id="radio2" />
  35.                 </th>
  36.                 <td>text2</td>
  37.                 <td>comment2</td>
  38.               </tr>
  39.             </tbody>
  40.           </table>
  41.         </div>
  42. </div>         
  43. </body>        
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement