tags:

views:

142

answers:

2

Can you tell me the code for dotted line on a long list for a table/column i.e.

Cell Column
Manicure.............$10.00

Where do I put it in the code as well, don't know css, yes html

Thanks in advance

A: 

I don't think a dot leader (which is what the dots you're looking for are called) is possible in pure html. You're going to have to use some css.

Here's a nice article that should get you started:

http://web-graphics.com/mtarchive/001622.php

Now that you know the name of what you're looking for, you can also google a bit and look around, but as I said, I think you're probably going to have to use css.

Toon Van Acker
+4  A: 

Here is something I just played around with (tested on IE8 and FF3):

<html>
    <head>
     <style>
      .dotted {
       position:relative;
       border-bottom: 1px dotted black;
       background:white;
       height:24px;
       width:300px;
      }

      .item {
       position:absolute;
       height:26px;
       line-height:30px;
       text-align:left;
       background:white;

      }
      .value {
       position:absolute;
       right:0px;
       height:26px;
       line-height:30px;
       background:white;    
       text-align:right;
      }
     </style>
    </head>
    <body>
     <div class="dotted">
      <span class="item">Manicure</span>
      <span class="value">$10.00</span>
     </div>
     <div class="dotted">
      <span class="item">Tanning</span>
      <span class="value">$100.00</span>
     </div>

    </body>
</html>
Jimmy Chandra
flaw is that if you have a transparent background it sort of not work, but for solid color background you should be fine :)
Jimmy Chandra
similarly, a different approach might be using a transparent .gif / .png containing dotted graphic as the background image for the containing div instead of the border-bottom attribute above. In that case the actual page background won't matter (will work).
Jimmy Chandra
Would it not be as easy to use <li></li> (and of course use either <ul> or <ol>) instead of the divs? I only ask because the question relates explicitly to 'lists.'
David Thomas
@drthomas: It just happened that I tried the code with DIV and SPAN. I don't see why it won't work w/ UL/OL/LI combo.
Jimmy Chandra