Answer:
Table salt is considered to be a compound because it is made up of two elements (sodium and chloride,) while sodium itself is a raw element. That's why table salt is considered to be a compound, while sodium is not.
Hope this helped, have a nice day! :)