Solved

Black border

Posted on 2001-06-25
14
260 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
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 …

773 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