Advanced Tables


Dont you hate it when your tables come out looking like garbage? Well there are loads of ways to make a table look good, heres mine! (I will also be using CSS incase anybody wants to copy it for thier own uses).

HTML Code
  1. <html>
  2. <head>
  3. <title>Your title here</title>
  4. <style type="text/css">
  5. <!--
  6. body {
  7. background-color: #000000;
  8. }
  9. a:link {
  10. color: #FFFFFF;
  11. }
  12. a:visited {
  13. color: #FFFFFF;
  14. }
  15. a:hover {
  16. color: #FF0000;
  17. }
  18. a:active {
  19. color: #FF0000;
  20. }
  21. body,td,th {
  22. font-family: Verdana, Arial, Helvetica, sans-serif;
  23. font-size: 9px;
  24. color: #FFFFFF;
  25. }
  26. -->
  27. </style>
  28. </head>
  29. <body>
  30. <br>
  31. <table width=80% cellpadding=0 cellspacing=0 border=1 frame=box rules=all align=center bordercolor=black bgcolor=#333333>
  32. <tr><td bgcolor=red><div align=center><strong>HEADER</strong</div></td></tr>
  33. <tr><td height=100 valign=top>
  34. Bienvenue à mon website! C'est bon!
  35. </td></tr>
  36. </table>
  37. </body>
  38. </html>


Okay now i will start with the first thing in the table tag. The code 'width=80%' will make the tables width 80% of the whole page. The code 'cellpadding=0' will make sure there are no paddings between rows/columns. The code 'cellspacing=0' will ensure that there are no spaces between rows/columns. The code 'border=1' will create a 1 pixel border around the whole table. The code 'frame=box' will make sure the border is all around the table and inside out (code has much more of an effect when viewed on firefox). The code 'rules=all' will ensure that the border is around everything in the table (apart from the content). The code 'align=center' will align the table into the center of the page. The code 'bordercolor=black' will make sure that the border colour is black. The code 'bgcolor=#333333' will set the tables background colour to a dark grey.

Okay now onto the code i added to the <td> tag. I firstly added the code 'height=100'. This code will make the height of the table row 100 pixels. The code valign=top will make all the text aligned to the top of the table.

Thats all for now
ilyas-shezad's Avatar
Views:
2,226
Rating:
There are currently no comments for this tutorial, login or register to leave one.