This is an ad.
 
Webmonkey Kids
Webmonkey Kids
Lessons
Projects
Playground
Tools

Introduction
icon Rows and Cells
Building Your First Table
Colspan
Rowspan
Alignment
Spacing and Padding
A Few More Tricks



Parents and Teachers:
Find out how your kids can use Webmonkey for Kids as a learning tool at home or in the classroom with our Planning Guide.

Send us feedback

Lesson A: Tables
A Few More Tricks


ere are a few other tricks you can use with tables to make the more useful:

You can tell the Web browser how wide you want your table to be inside the <table> tag. You can either say how many pixels wide it should be (a pixel is one little dot on a computer screen), or what percentage of the screen that the table should take up. So you can use <table width="50%"> so your table is always half the size of your visitor's screen, or you can use <table width="300"> to make sure that your table is always 300 pixels wide (which is about four inches).

You can also add any color you want to a table, just like adding a color to your page's background, by using the bgcolor command. So if you wanted your table to have an orange background, you could type in <table bgcolor="orange">. Simple as that.

So go to town. If you're having trouble figuring out how to get that big picture of your dog lined up next to your list of links, you can probably use a table to get it all organized.

Back

More Lessons