LinkExchange Member Free Home Pages at GeoCities



Moving Text
Images In Cell
Adding A Cell
Adding A Row
Adding A Link
Table Background
Row Background
Cell Background







Table Lesson 2

Great you've made it this far! Let's learn how to play around with your table.

(Just in case you need to go back to the first lesson I'll put a link to table tutor 1 here.



Let's move some text around inside the table first. This is what you write:

<table border="3" width="100" height="100">
<tr>
<td align="center">Comet</td>
</tr>
</table>

This is what you get:

Comet

Write this:

<table border="3" width="100" height="100">
<tr>
<td align="right">Comet</td>
</tr>
</table>

This is what you get:

Comet

You can put your text where you want in the table by changing the code. If you want it up top change it to align="top". Want it on the bottom? Just change "top" to "bottom".


Now, let's try getting an image into your table. Just replace the word Comet with your image file.

<table border="3" width="100" height="100">
<tr>
<td align="right"><img src="/hk11-13t.jpg"> </td>
</tr>
</table>

There you go! How's that? You're getting to be a regular html expert now! It took me several days to even get this far when I was teaching myself to do tables. So you must be doing a lot better than I ever did!


Now, let's make it a little bit more difficult. How about two cells? I'm going to go back to the word comet for right now and leave out the align attributes for the moment.

Type this:

<table border="3" width="100" height="100">
<tr>
<td>Comet</td>
<td>Asteroid</td>
</tr>
</table>

You get this:

Comet Asteroid

I would recommend that you specify the size. You don't have to but your table could really come out looking pretty funky and completely different from the way you intended it to!


To add more cells just keep putting in the <td>whatever you like here</td> codes till you get what you want. Of course that isn't always possible. Sometimes you want another row of cells. Wanna know how? Look below:

<table border="3" width="100" height="100">
<tr>
<td>Comet</td>
<td>Asteroid</td>
</tr>
<tr>
<td>Meteor</td>
<td>Moon</td>
</table>

You should have a table resembling this:

Comet Asteroid
Meteor Moon


Let's touch on linking inside a table really quick. It's just like putting an image in except you use the <a href=> code. Let's try it.

<table border="3" width="100" height="100">
<tr>
<td> <a href="/hk11-13t.jpg">Comet</a> </td>
<td>Asteroid</td>
</tr>

<tr>
<td>Meteor</td>
<td>Moon</td> </table>

You ought to get a link like this:

Comet Asteroid
Meteor Moon


Got it? Great! Let's start changing some colors around. We'll start with the entire table background. I'm going to take out the width and height right now so you won't get confused.

<table border="3" bgcolor="#3399CC">
<tr>
<td>Comet</td>
<td>Asteroid</td>
</tr>

<tr>
<td>Meteor</td>
<td>Moon</td> </table>

Comet Asteroid
Meteor Moon


Now, let's change the colors of each row

<table border="3">
<tr bgcolor="#FFCCFF>
<td>Comet</td>
<td>Asteroid</td>
</tr>

<tr bgcolor="#AAAAAA">
<td>Meteor</td>
<td>Moon</td> </table>

Comet Asteroid
Meteor Moon


Now change the color of each cell

<table border="3">
<tr>
<td bgcolor="#00FF00">Comet</td>
<td bgcolor="#CC9900">Asteroid</td>
</tr>

<tr>
<td bgcolor="#99FF00">Meteor</td>
<td bgcolor="#FF66FF">Moon</td> </table>

You get something really colorful like this:

Comet Asteroid
Meteor Moon

Boy those are terrible colors I picked! Oh! Hey! We're at the end! That's it! Did you find what you need? There is a bit more but it starts to get a little more complicated. You can do all sorts of things with a table. If you like to get fancy and you get really good at this stuff, try to make a table inside another table! Those can get scary! But once you get it down it isn't hard at all! Hope you enjoyed yourself. Let me know if you have any questions and I'll sure try to answer them!



Back To Community Resource Main Page
My Astronomy Home Page



Link Graphic