Paragraph numbering

Often, reviewers would like to point to problematic larger parts of a document. In pdf documents, you usually refer to page or line numbers but this is no option in FW for obvious reasons.
A solution for these cases could be a numbering of paragraphs. Following this thread, I have tweaked the document template CSS and come up with the following solution:

.user-contents p {
    counter-increment: paragraph;
}

.user-contents p::before {
    position: absolute;
    text-indent: 0px;
    left: -45px;
    padding-top: 2px;
    font-size: 80%;
    color: #888888;
    content: counter(paragraph);
}

This works fairly well. Only in the case of tables, each cell is obviously counted once which leads to a mess of numbers. Any suggestions how to exclude tables from the counter would be appreciated.

To answer my own question: I have played around a little bit more and found the following solution:

table tr p {
    counter-increment: none !important;
}

table tr p::before {
	content: none !important;
}

This works as expected but only with the !important-tag. As this is usually considered bad practice, perhaps someone else has a cleaner solution?

1 Like

The CSS selector generally has to be more specific in order for it to be chosen over the existing one.

So if the original is

.user-contents p::before

Then this one will likely work:

.user-contents table tr p::before 

In general I would not worry about the usage of !important. There are many situations in which there really is no other option than !important.

Many thanks! This works indeed.