The standard grips this chord is usually shown with.
Dmaj9 is D, F#, A, C# and E, a major ninth. The shape this page opens on is written x52222, lowest string first.

Also written DM9, DΔ9, Dma9 or D major 9. The same chord either way; which spelling you meet depends on who wrote the chart.
There are 12 common shapes for Dmaj9 on the guitar, and 39 derived voicings in 5 families.
In which keys. Every note of Dmaj9 belongs to D major (the I), F# minor (the ♭VI), A major (the IV) and B minor (the ♭III).
The common shapes, written lowest string first: x52222, x5465x, 55465x, x90979, x77779, xx7979, 10-7-7-7-7-9, 10-9-11-9-10-9, 10-12-11-11-10-12, x-x-11-11-10-12, x-x-12-11-14-12, 14-12-12-14-14-12.
Shell. Root, third and seventh: the guide tones fix the quality, so the fifth is dropped. That is what leaves a string free, so pick a tension to put on top. Dmaj9 has x5465x, 10-9-11-9-x-x, x-x-12-11-14-12.
Drop 2. A close-position chord with the second voice from the top lowered an octave. Sits on four adjacent strings. Dmaj9 has x5465x, 10-9-11-9-x-x, 2526xx, xx2632, x-7-11-7-7-x, x-x-11-9-7-10, x-x-12-11-14-12, xx4759.
Drop 3. The third voice from the top lowered an octave. The dropped voice becomes the bass, which is why a string is skipped. Dmaj9 has x5x652, 2x263x, x7x779, 10-x-11-9-7-x, 12-x-12-11-14-x, 9x475x, x-9-x-9-14-10.
Rootless. The root left to the bass player. Frees a finger for a tension. Dmaj9 has xx2222, xx4655, x7767x, xx7979, x-9-11-9-10-x, x-x-11-11-10-12, x-x-14-14-14-14, x4425x.
Open string. An open string left ringing against a fretted grip. Because it costs no finger, it sounds a note the closed shape has none left for -- a tension on top, or a pedal root underneath. Either a familiar grip with open strings added, or a shape so sparse the open strings carry the chord. These belong to their key rather than to a shape, so D, A, G and E have many and Eb a handful. Dmaj9 has 070675, 00460x, x04600, 00067x, x00670, 0x4600.
Tensions. A shell of Dmaj9, root, third and seventh, leaves a string free, and the tones that belong over it are the #11 (G#) and the 13 (B).
The common shapes and the derived voicings come from different places, and both are explained in where the chords and the theory come from.
Shows each chord the way this style would voice it, and marks which of its alternatives belong to the idiom.