In those cases where merchants are not in a typical category, full details are provided on the specific item types they will buy and sell. The merchandise column provides information on what type of merchandise each merchant will buy and sell. Investing in a merchant improves that merchant's disposition towards you. These merchants are not checked in the 'Invest' column in the following tables, but instead the bug is noted on the individual merchant page. Some merchants are bugged - they have the dialogue allowing you to pay them 500 gold, but doing so does not result in any permanent change in the merchant's available gold.
The merchants who have more gold are all identified in the notes of the following tables. Merchant gold can be increased in several ways: Gold is reset each time the merchant's inventory is reset or every 48 hours. Merchants will generally have 3-40 gold more than listed, because their personal pocket change is added to the merchant-specific gold. The amount listed under 'Gold' is the base amount of gold that the merchant has available to purchase items from the player. For those added by the Dragonborn add-on, see this page.
This page summarizes all of the merchants available in Skyrim.