give border a single border for two adjacent cells in css - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

give border a single border for two adjacent cells in css

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 {<!--from  www.j a v  a  2  s.  c o m-->
   background-color: silver;
   border-collapse: collapse;
}
td {
   padding: 5px;
   border: 1px solid red;
   border-width: 1px 1px 1px 0px;
}
td.label {
   border-width: 1px 0px 1px 1px;
}


      </style> 
 </head> 
 <body> 
  <table cellspacing="0"> 
   <tbody> 
    <tr> 
     <td class="label">Label1: </td> 
     <td>input1</td> 
     <td class="label">Label2: </td> 
     <td>input2</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials