It seems you are using the Mac version of Word, which I hadn't noticed
. The code is unlikely to work on the Mac version. It also won't work in tables that have split/merged cells, like those in your first table, but the PC version should work in your other tables.