Saturday, February 15, 2025

So, You Want Color in a Table, Huh?

Use these to jump around or read it all…

[A Simple Color Table] [Changing Text Color, Too]

     I should point out that this tutorial will not get into the creation of the table itself, only changing the background and text color. To read up on how to make a table, see the Table tutorial.

A Simple Color Table

     Dig this…

Yellow Stars Green Clovers
Purple Moons Blue something or other…

Here’s What Did It

<TABLE BORDER=4 CELLSPACING=4 CELLPADDING=4>
<TR>
<TD BGCOLOR=”#ffff00″>Yellow Stars
<TD BGCOLOR=”#00ff00″>Green Clovers
</TR>
<TR>
<TD BGCOLOR=”#ff00ff”>Purple Moons
<TD BGCOLOR=”00ffff”>Blue something or other…
</TD>
</TR>
</TABLE>

 

     Notice it’s just a basic table with a BGCOLOR= command stuck in now and again for good measure. That’s how you do it. Whatever color you would like, put either the hex code or the word codefor the color and you’re off and running.

Changing Text Color, Too

     Dig this too…

Yellow Stars Green Clovers
Purple Moons Blue something or other…

Here’s What Did It

     At least here’s the top left cell…

<TD BGCOLOR=”#ffff00″>
<FONT COLOR=”#800517″>Yellow Stars</FONT>

     Notice it’s the same commands as for the table. I just used the font colorcommands to change the text color.

     Put it all together and you can create some pretty awful looking tables!

 Enjoy!

[A Simple Color Table] [Changing Text Color, Too]

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured