Food grade salt (Sodium Chloride) in most parts of the world is evaporated from sea water. It generally does not have any detectable mercury, though it does have many other trace elements, some of which are normal dietary minerals
Mined salt (rock salt) is generally used for industrial purposes and de-icing, it contains "dirt", but generally not mercury. In most cases, rock salt is salt from old sea water when it was trapped and evaporated millions of years ago, so has the similar trace elements as fresh evaporated sea water
Some 'speciality' salts, like Himalaya salt, are just rock salt deposits that are more contaminated than normal. Some of these contaminants are normal dietary minerals, most are not e.g. Iron oxide
One interesting exception is the mineral Iodine. It is usually added to food grade salt (fresh evaporated or old rock), as it does not often appear naturally, and many people in the world have diets that are deficient in it
Mercury salts exist in sea water for only a very short time before it is bio-accumulated by algae and then eventually by large order fish. Most heavy metal salts do not stay in sea water for any length of time, but are quickly absorbed by other organisms