Tables


Ok well tables are a good way of organizing stuff on your site. Also, most layouts are made using tables. You can put almost whatever you want in it and it would still be easy to understand and all. But, they are also very hard to explain. So for this section I'm gonna explain it step by step, and if you don't like it, sux for you because all other html sites do this.
Click here for some premade table codes u can use

Quick Vocab

Row- Goes from left to right.

Column- Goes from top to bottom.

Cell- The actual box thing you put things in. Sort of like a coordinates (lol).


Well first of all, you have to start by adding this code:

<table>

This is the main tag, just like an "a" tag for links, or a "img" tag for images. In it is where you would put all the things like background colors, width & height, border, ect. Here's a list (using a table, lol) of things you can put in the "table" tag.

Customize Your Table
Code
What IT Does
border="NUMBER"
border width
bordercolor="COLOR"
border color
bgcolor="COLOR"
background color
background="URL"
background image
cellpadding="NUMBER"
space b/t border and text
cellspacing="NUMBER"
space b/t each cell

*Replace the capitalized words w/ whatever u want. This isn't the only stuff u can put in, but until u get use to tables, it's all u'll really need.


Next, you have to add the "row" tag:

<tr>

Just like the "table" tag you can customize your rows with the codes above, however they only only affect that specific row.


Finally the columns, which is basically the cell where you put in all the stuff. Remember, u can also use the codes in the table, but this will only affect that specific cell.

<td>

Once you put in the "td" you're ready to put all the content, or whatever you want to put in. When finished with that you have to close the cell by putting this:

</td>

If you want more than one cell in a row then you repeat that last step and add as many "td"s and "/td"s as you want.


Afterwards you have to close the row by putting a:

</tr>

Again if you want more than one row, add as many more "tr" tags as you want.


Finally, once done with everything you have to close the table by putting this:

</table>


If you followed the steps from above, the table you made should look something like this (unless you changed the colors and all that).

BLAH BLAH

The code would be:

<table border=1 cellpadding=4 cellspacing=2><tr><td>BLAH BLAH</td></tr></table>


Row & Column Spans

You can aslo make one column two or more rows, or make a row two or more columns. You'd do that by adding this to the "td" tag:

rowspan=2 - to make a column take up 2 rows
colspan=2 - to make a row take up 2 columns.

You can change the 2 to any number you want, that stands for how many rows or columns you want.

Example:

AB
C
D
A
BCD
EFG
Code:
Code:


Premade Tables

These are just the actual layout of some tables, not with the colors or anything. And they're not that small, i just did it that way so that it doesn't take too much space. If you put a lot of stuff in it, it will become bigger (duh).
* The letters are there to tell you which cell that is.


No Row Borders

ABC
DEF
GHI

Code


No Inside Borders

AB
CD

Code


No Column Borders

AB
CD
EF

Code


ABCD
EFG
HI
JKLM

Code


A A A
B B
B B
C
D

Code


You can do a lot of things with tables. Be creative with tables, experiment and add stuff to them. If you make something cool or just need help with tables, contact me.


Back