The deadweight loss will be larger in Market A than Market B because the supply curve is more elastic in Market A than in Market B. The more elastic (inelastic) the supply, the more (less) that quantity decreases when the tax increases the price. The amount by which quantity decreases is the key factor for measuring deadweight loss. The decrease in quantity is the "base" of the deadweight loss triangle. Recall that we measure the area of a triangle as 0.5 x base x height. The height is the amount of the tax, which remains constant in this comparison. The more (less) that quantity responds to a change in price, the larger (smaller) the area of deadweight loss.
The figure below illustrates the area of deadweight loss using a $3 tax in each market.