So don't do it. Index tags within titles Don't put index tags within headings, since headings are some of the most automatically formatted text in the document. If you absolutely have to drop an index tag within a heading, it must go just before the closing tag. I would consider this only if what the title is titling is unindexable, such as a figure or sourced-in material. Both of these examples are mentioned below.
Tables are complicated enough without throwing in index tags.
Also, should there be special formatting information for a particular table entry or column or section, such as having every entry in the leftmost column in boldface type, an index tag will disturb that. The information here is crucial to the table's format. An index tag in here might cause the table not to print entirely. Index tags within code Do not put index tags within code. Doing so is just asking for the code to get unformatted.