css <table> border

I have this css code that I am having trouble modifing. First off this code effects all tables, what do I need to do to apply this style to specific tables and not others? Also how do I correctly define its bgcolor? I keep trying different things and nothing seems to work out. Thanks in advance for any help.<br />
<br />
<!--<br />
table {<br />
border: 1px solid green;<br />
}<br />
--><!--content-->http://www.w3schools.com/css/css_border.asp<br />
Lotsa info and examples.<br />
Mostly I use inline styles for <table/tr/td> attributes, although I have used classes for remote stylesheets.<!--content-->Instead of assigning your style to a specific element (as you are doing here by assigning the style to the <table> element), you need to create a class. Classes are unique identifiers that you can call upon in your HTML to apply styles to. Here is an example:<!-- in the head section --><br />
.myClass { <br />
border: 1px solid green; <br />
}<br />
<br />
<!-- in the body section --><br />
<table class="myClass"><br />
<tr><br />
<td>&nbsp;</td><br />
</tr><br />
</table><br />
Note that in the style definition a class is signified by preceding its name with a period. However, when you call the class from within your HTML you reference only the name (lose the period).<br />
<br />
Here is an excellent CSS site:<br />
<br />
<!-- m --><a class="postlink" href="http://www.mako4css.com">http://www.mako4css.com</a><!-- m --><!--content-->
 
Back
Top