The Palace of Versailles was built before the Taj Mahal.
Mughal emperor Shah Jahan commissioned the Taj Mahal in 1631 to house the tomb of his favorite wife. Construction began in 1632 with completion of the mausoleum proper in 1643. Work continued on other phases for 10 years until completion in 1653.
The Palace of Versailles was built as a brick and stone hunting lodge by Louis XIII in 1624. Louis XIV enlarged it into a royal palace. The first phase of the expansion occurred from about 1661-1678 and the second phase from about 1678-1715.