The standard grips this chord is usually shown with.
Dmaj7 is D, F#, A and C#, a major seventh. The shape this page opens on is written xx0222, lowest string first.

Also written DM7, DΔ7, DΔ, Dma7 or D major 7. The same chord either way; which spelling you meet depends on who wrote the chart.
There are 8 common shapes for Dmaj7 on the guitar, and 32 derived voicings in 4 families.
In which keys. Every note of Dmaj7 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: xx0222, x54222, x5463x, x57675, xxx779, xx7779, 10-12-11-11-10-10, x-x-12-14-14-14.
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. Dmaj7 has x546xx, 10-9-11-x-x-x, x5x67x, 10-x-11-11-x-x.
Drop 2. A close-position chord with the second voice from the top lowered an octave. Sits on four adjacent strings. Dmaj7 has x4423x, xx0222, 2402xx, 5546xx, x5767x, xx7779, 9977xx, x-x-11-11-10-10.
Drop 3. The third voice from the top lowered an octave. The dropped voice becomes the bass, which is why a string is skipped. Dmaj7 has 2x022x, x4x232, 5x463x, x5x675, x-9-x-7-10-9, 9x777x, x-12-x-11-14-10, 10-x-11-11-10-x.
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. Dmaj7 has 554600, x57670, x44230, 5x4630, x04600, x00670.
Tensions. A shell of Dmaj7, root, third and seventh, leaves a string free, and the tones that belong over it are the 9 (E), 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.