Mezhat: Nominal Categories: Pronominal and Adnominal Demonstratives: Identical
Technically, they behave in the same way as adjectives/attributive verbs, which are difficult to describe -- they agree with the noun in case and gender when adnominal, and can act as independent nouns with no change in form (keeping the gender agreement). Thus, a generic "that" is typically in the inanimate gender, and matches only some adnominal forms.