Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A table border question

Status
Not open for further replies.

RhythmAddict112

Programmer
Jun 17, 2004
625
US
Hi all...Quick CSS q for you CSS gurus...

I want to color the outside border of my table one color, and the inside border a different color...What's the best way to do this?





Use your resources, you're on the internet!
 
If you don't want to cheat and style every border on your own, you could do it like this:
Code:
<style type="text/css">
table {
  border: 1px solid red;
  border-collapse: separate;
}

th, td {
  border: 1px solid blue;
}
</style>

<table cellspacing="0">
 <tr>
  <td>Test 1,1</td>
  <td>Test 1,2</td>
  <td>Test 1,3</td>
 </tr>
 <tr>
  <td>Test 2,1</td>
  <td>Test 2,2</td>
  <td>Test 2,3</td>
 </tr>
</table>
 
I'd like to through out the div alternative. Check out what this looks like and how many more options are available to you (a small fraction demonstrated below). Also note that this is very cross-browser:
Code:
<div id="outside">
  <div id="inside">
This is some text.
  </div>
</div>

and the css:
Code:
#outside{
	float: left;
	padding: 1px;
	border: 2px outset #009100;
	}

#inside {
	padding: 4px;
	border-left: 4px solid #600000;
	border-top: 4px solid #409000;
	border-right: 4px solid #000050;
	border-bottom: 4px solid #202020;
	}
 
thanks for everyones suggestions, I love this board...





Use your resources, you're on the internet!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top