Padding changes width inside table - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Width

Description

Padding changes width inside 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">
*{  }<!--from  w w w .  j  av  a 2  s.c  o m-->
table {
   background-color:Chartreuse;
   width:301px;
}

table input {
   width:91%;
   padding-left:11%;
}
</style> 
 </head> 
 <body> 
  <table cellspacing="25"> 
   <tbody> 
    <tr> 
     <td> <input type="text" placeholder="lalala"> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials