Advertisement
here2share

HTML table width and height all visible

Aug 16th, 2016
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.78 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. table, td, th {
  6.     border: 1px solid black;
  7. }
  8. table {
  9.     border-collapse: collapse;
  10.     width: 100%;
  11. }
  12. th {
  13.     height: 30px;
  14. }
  15. td {
  16.     padding-left: 20px;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21.  
  22. <h2>The width and height Properties</h2>
  23. <p>Set the width of the table, and the height of the table header row:</p>
  24.  
  25. <table>
  26.   <tr>
  27.     <th>Firstname</th>
  28.     <th>Lastname</th>
  29.     <th>Savings</th>
  30.   </tr>
  31.   <tr>
  32.     <td>Peter</td>
  33.     <td>Griffin</td>
  34.     <td>$100</td>
  35.   </tr>
  36.   <tr>
  37.     <td>Lois</td>
  38.     <td>Griffin</td>
  39.     <td>$150</td>
  40.   </tr>
  41.   <tr>
  42.     <td>Joe</td>
  43.     <td>Swanson</td>
  44.     <td>$300</td>
  45.   </tr>
  46.   <tr>
  47.     <td>Cleveland</td>
  48.     <td>Brown</td>
  49.     <td>$250</td>
  50. </tr>
  51. </table>
  52.  
  53. </body>
  54. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement