Center align table cell inside a table - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Center align table cell inside a table

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">
table,.alignright {
   width:auto;
   margin:0px auto;
   text-align:right;
   table-layout:fixed;
   font-size:0.10em;
}

table,.alignleft {
   width:auto;
   margin:0px auto;
   text-align:left;
   table-layout:fixed;
   font-size:0.10em;
}

.tableButtons {<!-- w  w  w .ja  v a2 s.c  o m-->
   width:251px;
}

.searchField {
   width:301px;
}
</style> 
 </head> 
 <body> 
  <table style="border:1px solid black"> 
   <tbody> 
    <tr> 
     <td class="alignright"> <select id="exactField"> <option value="default">Lorem ipsum</option> </select> <input type="text" class="textBox" id="exactValue"> </td> 
     <td class="alignleft"> <button type="button" class="clear"> <bdi>Lorem ipsum dol</bdi> </button> <button type="button" class="submit"> <bdi>Lorem ipsum dolo</bdi> </button> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials