In the Dungeons & Dragons game, a template can be applied to a creature to enhance its abilities or to even create a new type of creature.
Templates can be either acquired or inherited. An acquired template can be applied to a creature at any point (assuming it meets the prerequisites for the template), while an inherited template is gained at birth (or creation). For example, undead are usually acquired templates, as they are usually created upon the death of a living creature. On the other hand, a half-dragon results from the mating of a dragon with another creature, and thus is inherited.
Some of the more common templates include the celestial creature, fiendish creature, half-celestial, half-fiend, half-dragon, and various templates to create lycanthropes and undead.
In their current form, templates were first introduced to the Dungeons & Dragons game in the Third Edition Monster Manual and since then numerous templates have appeared in each new monster supplement, and often in the monster sections of other rulebooks.
Technically, the earliest template introduced for use with the AD&D game system - quite different than those currently in use with the Third Edition game - was published in the First Edition game's Dungeon Master's Guide, which features tables to aid in the "random generation of creatures from the lower planes". Subsequent other First Edition handbooks, notably the Monster Manual II, as well as Dragon Magazine, featured additional early monster generation templates.