Solved

Black border

Posted on 2001-06-25
14
273 Views
Last Modified: 2010-04-09
It's fairly simple, all I want is a table with a BLACK border (in Netscape). I have set the bordercolor, bordercolorlight and bordercolordark properties. But still it's NOT black... I hope someone can help me. My HTML is a bit rusty :-/

Regards,
CJ
0
Comment
Question by:CJ_S
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
  • +1
14 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6224326
I take it you don't want to use the "workaround" of "building" a border using background colour and a transparent gif in the table?

I find Netscape very inconsistent when it comes to border colours and the like, on tables.....

:o)

Ant
0
 
LVL 22

Author Comment

by:CJ_S
ID: 6224341
Nope...

the following was my latest "invention", but it keeps some space between the boundaries

<html>
 <head>
  <style type='text/css' disabled>
  DIV.b{border:1px solid black;padding:20px;}
  </style>
 </head>

 <body bgcolor=yellow>
 <div class='b'>
 <table border=0 cellspacing=0 cellpadding=0 bordercolor=black bgcolor=black>
  <tr>
   <td>TEST</td>
  </tr>
 </table>
 </div>

</body>
</html>
0
 
LVL 22

Author Comment

by:CJ_S
ID: 6224345
padding:0px or no padding in the style :-)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Accepted Solution

by:
a.marsh earned 100 total points
ID: 6224351
The "workaround" I mentioned

<table width="104" border="0" cellpadding="0" cellspacing="0">
<tr>
  <td width="2" rowspan="3" bgcolor="#000000"><img src="clear.gif" width="2" height="5"></td>
  <td width="100" bgcolor="#000000"><img src="clear.gif" width="5" height="2"></td>
  <td width="2" rowspan="3" bgcolor="#000000"><img src="clear.gif" width="2" height="5"></td>
</tr>
<tr>
  <td>Content goes here - might want to put another table in to get better margin space etc.</td>
</tr>
<tr>
  <td bgcolor="#000000"><img src="clear.gif" width="5" height="2"></td>
</tr>
</table>


Ant
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6224356
I know you new that anyway!! :oP

Ant
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6224376
You mean when you set the padding to 0px, you should get a solid back box?

Ant
0
 
LVL 22

Author Comment

by:CJ_S
ID: 6224398
yep, like in Internet Explorer.

I really hope to get this straight for once and for all, because sometimes the 1 pixel width cells are pretty annoying :-) and can be disturbed rather easily.

Regards,
CJ
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6224405
Well I'm using Netscape 4.x on Linux and there is more than a 1 pixel width on the example code you gave above (obviously changing the 20px to 0px!)

:o)

Ant
0
 
LVL 22

Author Comment

by:CJ_S
ID: 6224441
0px still shows some blank space :-/
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6224472
It does and I'm can only assume it is because of the way Netscape works with the <div>

Ant
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6224581
Where do you want the border? Around all the cells, around the table, or only around some cells? All of them are pretty easy, just takes some table tricks.

Around the table --
Set up a container table, 1 row 1 cell, set cellPADDING to the border you want. Give the one cell a background of black. Set the background color on the inside table to the background color of the page (I'm assuming white).

Around all the cells --
Set up a container table again, but set cellSPACING on the INSIDE table to what you want the border to be. You still need the cellPADDING on the OUTSIDE table to get the outside border.

On some of the cells --
This is where it gets trickier. It needs to be set with fixed pixel sizes. YOu have to set up those cells with the black background and aligned center, and nest in them another table, sized to be however many pixels narrower as you want your border to be. If you want a one pixel border, the inside table has to be 2 pixels smaller. You can use cellpadding if you want ALL the cells in the table to have that much space, otherwise you need to set the inside table size.

You notice there are NO transparent GIFs in this.... ;-) You can use them, and I have for other things, but you can get around it.
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 6224583
the best workaround I always use is to create a table and set in the border row cells (2) and column cells (2) 1x1 pixel images and set their width/height empty.. this way the cell will get the img width or height and you will get a nicely formatted border and the best thing that it's cross browser compatible.. check the similar yellow borders I made here www.iband.sh
0
 
LVL 22

Author Comment

by:CJ_S
ID: 6224591
I know about all those options, I was actually hoping for a way with the attributes specified, or with one additional tag (like with the div tag in my example).

I just implemented the usual way with 1 pixel wide cells. I dislike the approach but there's no other way I guess.

regards,
CJ
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 6224593
Heh webwoman got that.. first.. lots of concurrency on HTML.. I'll better go back to ASP
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add a little space on either side of a table. 12 32
Html date format 9 29
Diff of the day 2 41
SSL unsecure page mystery 17 46
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question