[HTML][JavaScript][Computer Stuff][Freeing the Mind]

Ken Ward's HTML Tutorial ...

Table cell padding and spacing!

This table does not have any padding of any kind (except my words!)

No padding here, I'm afraid! When we put a lot of text in a table then we find that the text tends to brush up to the border of the table and it looks a bit cramped.

However, we can fix it with a bit of padding.

However, this table has cell padding!

This is the code in the table; <table border="5" cellpadding="20"> When we put a lot of text in a table then we find that the text tends to brush up to the border of the table and it looks a bit cramped.

Cell padding puts some space between the border of the cell and the text. Aren't I much prettier than before? Well, you know what you can do then. Put your own values in!

And this table has cell spacing!

This is the code in the table; <table border="5" cellspacing="20"> When we put a lot of text in a table then we find that the text tends to brush up to the border of the table and it looks a bit cramped.

Cell spacing puts some space between the cells themselves in the table.

And this little pig, er table, had all the padding and spacing it wanted!

This is the code in the table; <table border="5" cellpadding="20"> When we put a lot of text in a table then we find that the text tends to brush up to the border of the table and it looks a bit cramped.

Cell padding puts some space between the border of the cell and the text. Cell spacing puts some space between the cells. This table has both.

Did you notice that I put rather big values in for the padding, and for the border, so it was very clear what was going on? It is a good idea to be brave and try a few things. Be outrageous, and you'll find out how things work!

 

Let's look at frames


[back to: aligning the contents of table cells!]
[home][contents]
[on to:  frames]


Most Recent Revision: 18-Oct-98.
Copyright © 1998

I am always pleased to hear from you.
Send your comments to