Forum How do I...?

Table of content: dotted line

ixgal
hi,

is it possible to have a dotted line between the chapter title and the page number? (in the TOC). Like in this example:

http://i.stack.imgur.com/v1ujf.png

thanks
mikeday
Yes, using leaders, eg. like this:
.toc a[href] {
    content: leader('.') target-counter(attr(href), page)
}
ixgal
hi Michael, after adding this, the dotted line appears ok, but the chapter titles are not displayed any more, on the toc. Like this:

.............9
.............17
.............45
skycaptain
they are not appearing since michaels script is replacing the content in the a-tag itself. use a[href]::after instead:
.toc a[href]::after {
    content: leader('.') target-counter(attr(href), page)
}


or maybe (untested)

.toc a[href] {
    content: content() leader('.') target-counter(attr(href), page)
}

Edited by skycaptain