1773, "lively square dance for four couples," from French quadrille, originally one of four groups of horsemen in a tournament (a sense attested in English from 1738), from Spanish cuadrilla, diminutive of cuadro "four-sided battle square," from Latin quadrum "a square," related to quattuor "four" (see four). The craze for the dance hit England in 1816, and it underwent a vigorous revival late 19c. among the middle classes. Earlier a popular card game for four hands (1726).
Quadrille began to take the place of ombre as the fashionable card game about 1726, and was in turn superseded by whist. [OED]