By the way, I don't have a problem with the stuff after the entry. Just the tab before the entry.
You can't add a tab before an entry via the TOC tools - you could put a request here https://indesign.uservoice.com/forums/601021-adobe-indesign-feature-requests
That's the best place to make your request.
Although, it is not needed, you can make Paragraph Style for your Table of Contents text, which I always do, a separate individual style for your TOC entries.
You can then set the left indent to your required tab stop. Even include a first line indent so if it flows over 2 lines it still lines up.
Use a left indent in the paragraph style used for the TOC entry
I have the style set up. Everytime I update the contents, I have to physically add the tab as the first character. I've got that process down to a replace-all end of paragraph mark with an end of paragraph mark tab. Just wanted to know if there is a parameter in the TOC that would automatically do this for me.
Again: define the style you want to use for the TOC (that is a seperate style than the one you set to be in the TOC, vlick on more options to define which seperate style to use for each TOC entry*) and set the left indent there. With a left indent no need to set a tab.
*Let say you have added the style Header to be in the TOC. You then create a new, seperate style, lets call it HeaderTOC, then in the create Table Of Contents options you set the style HeaderTOC to be used for Header. In the HeaderTOC style you set the left indent. No tab needed. Be sure to Save your settings in the Create Table of Contents dialog! If you do not save the setting does not get remembered next time you update the TOC!
One of us doesn't understand..:it could be me. The left indent doesn't apply here because the tab aligns the text to a right alignment tab followed by a left alignment tab as displayed in the attached example.
I totally agree with @mompcomike.
The left indent couldn't never be the correct answer!
(Or maybe I misunderstood that answer - who knows.)
Yes, I also think that there is no automatic solution with the TOC function in InDesign. But with a few changes afterwards, the desired result is possible (and reproducible).
page7 - page30
In normal way created TOC
open Grep Find and Replace window
replace with: \t$0\t
find format: [your "TOC item format"]
Done. But now the "two lines entries" are not correct.
Search the middle space in these line and select.
Replace (only) this space with [tab][tab][shift+Enter][tab]
Quick and easy result:
One disadvantage: After editing and re-creating the table of contents, the shown changes must be made again.
If that works for you
I understand the concept (even through the language barrier). It is kind of like my solution, but I don't know the GRep symbols ^[^\t]+\t\d+. I'll try to figure it out though. Thanks. This is probably the best solution.
Ah! I guess I misunderstood. You need a right align, did not see the screenshot example. Yes you need a right tab there as well. My bad, misunderstood 😞 (Will unmark as correct answer).
Although you can set the Between entry and pg nr. code to be and a tab and a right align tab (^t^y) you can not set a tab before the entry...
here a short description of the Grep.
--> find format: [your "TOC item format"]
Only search and find in this paragraph (or character) style.
--> find: ^[^\t]+\t\d+
^ = begin of paragraph
[^\t] = all characters that are not tabs
+ = one or more times
\t = one tab
\d = one digit
+ = one or more times
--> replace with: \t$0\t
\t = tab
$0 = all what you have found in the actually hit
\t = tab
Hope that helps a little.