Solved

Black border

Posted on 2001-06-25
14
250 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
  • 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
 
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
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.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now