Example of setting HTML table dimensions with width and height - HTML CSS HTML

HTML CSS examples for HTML:Table

Description

Example of setting HTML table dimensions with width and height

Demo Code

ResultView the demo in separate window

The CSS property width and height property also set dimensions of a table.

<!DOCTYPE html>
<html lang="en">
 <head> 
  <title>Example of setting HTML table dimensions</title> 
 </head> <!-- w  w  w.ja  v  a2 s .  c o  m-->
 <body> 
  <table border="1" width="400" height="100"> 
   <tbody>
    <tr> 
     <td>row 1, cell 1</td> 
     <td>row 1, cell 2</td> 
    </tr> 
    <tr> 
     <td>row 2, cell 1</td> 
     <td>row 2, cell 2</td> 
    </tr> 
   </tbody>
  </table> 
 </body>
</html>

Related Tutorials