MonkeyDoIt! Simple Instructions
Computers > Web Design



Add a Style to Table TD Tags using CSS Class





Simple instructions for adding CSS Styles to HTML table TD tags using CSS class:

1. Find the table you wish to apply a TD CSS Class to. Here is a simple table example:

<table border="2" bordercolor="#cccccc">
<tr>
<td>
Your content text is here!</td>
</tr>
</table>

2. Locate your <td> tag inside your table tag that you want to apply a style to:

<table border="2" bordercolor="#cccccc">
<tr>
<td>Your content text is here!</td>
</tr>
</table>




3. Add class to the td. Here I will call it "purpleData" but you can use anything:

<table border="2" bordercolor="#cccccc">
<tr>
<td class="purpleData">Your content text is here!</td>
</tr>
</table>

4. Create the style class in your HTML document inside the <head>X</head>. Here I am simply assigning text to appear purple and bold. You will note the class starts with "td" followed directly by a dot "."and then the class purpleData.

<style type="text/css">
<!--
td.purpleData { color: #9900CC; font-weight: bold; }
-->
</style>



5.
Save changes. Below would be the outcome.

Your content text is here!