Table column width as needed - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Column

Description

Table column width as needed

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">
body {<!-- w ww.ja v a2 s  .  c o  m-->
   width:auto
}

table {
   overflow:auto;
}

td {
   white-space:nowrap;
}
</style> 
 </head> 
 <body> 
  <table border="1"> 
   <tbody> 
    <tr> 
     <td>Lorem ipsum dolor sit amet, consectetur adipiscing elit. M</td> 
     <td>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper mol</td> 
     <td>Lorem ipsum dolor sit </td> 
     <td>Lorem ipsum dolor sit amet, consectetur adipiscing el</td> 
     <td>Lorem ipsum dolor s</td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolor s</td> 
     <td>Lorem ipsum dolor sit amet, consectetur adipiscing el</td> 
     <td>Lorem ipsum dolor sit amet, consectetur adipiscing elit. M</td> 
     <td>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper mol</td> 
     <td>Lorem ipsum dolor sit </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials