center a checkbox in a table cell - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

center a checkbox in a table cell

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.center {<!--   w  ww  . java2 s . c om-->
   text-align:center;
   vertical-align:middle;
}

td, th {
   padding:6px;
}

tr {
   height:26px;
}
</style> 
 </head> 
 <body> 
  <table style="empty-cells:hide;" border="1" cellpadding="1" cellspacing="1"> 
   <tbody> 
    <tr> 
     <th>Lorem i</th> 
     <th>Lorem</th> 
     <th colspan="2">Lorem ipsum dol</th> 
     <th>Lorem ipsum dolor si<br> </th> 
    </tr> 
    <tr> 
     <td class="center"> <input type="checkbox" name="query_myTextEditBox"> </td> 
     <td>Lorem ipsum dol</td> 
     <td> <select size="1" name="myTextEditBox_compare_operator"> <option value="=">Lorem </option> <option value="<>">Lorem ipsum do</option> </select> </td> 
     <td> <input type="text" name="myTextEditBox_compare_value"> </td> 
     <td class="center"> <input type="checkbox" name="report_myTextEditBox" value="checked"> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials