How to create a dotted table border using a 1 pixel image

Hi All,

How can I create a dotted border using a 1 pixel dotted image around a 200 * 200 table thats  "cross browser" compatible?

I tried using the dotted feature of style sheet, but it was rendering things different in different browsers. As I was googling around, somebody mentioned that you will need to use an image to generate a cross browser .

here is a sample code I am trying to play with. I am able to generate the dots horizontally, but not able to create a vertical dotted line for that square table. I am looking at IE 6, & FF2 on Pc

<style type="text/css">
#dots { width:200px; background-image: url("/images/grey-dot2.gif"); padding:2px; background-color:#fff; }
#main { background-color:#fff; }
<div id="dots">
<table id="main" width="200" border="0" cellpadding="0" cellspacing="0">
    <td width="200" height="200">&nbsp;</td>

Open in new window

Who is Participating?
Göran AnderssonConnect With a Mentor Commented:
Maybe your image is wrong? It looks nicely dotted to me, all around:

#dots { width:200px; background: #fff url(""); padding:2px; }

Tested in IE6, IE7, Firefox 2.
Sinoj SebastianConnect With a Mentor CTO & OpenERP Project managerCommented:
I think you can use dotted border
<style type="text/css">
  #div1 {border:1px dotted black;}
<div id="div1">test <br> test<div>

Open in new window

dynamotaAuthor Commented:
You are right. The image we were given was not designed correctly. And hence it displayed things incorrectly.

sinoj & GreenGhost, tx much for all the help.

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

dynamotaAuthor Commented:
GreenGhost & Sinoj, I ended up splitting points incorrectly. Wanted to give gg the 300 as he was able to my question with respect to the image. I am hoping that the admin can help fix the points

Sinoj SebastianCTO & OpenERP Project managerCommented:
>> I am hoping that the admin can help fix the points
Post a request to reopen the thread here
and assign the points as you wish

Glad to help you :)
dynamotaAuthor Commented:
Thank you all very much ...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.