The Destiny Knot takes 5 Random IVs from each parent, and as you explained before, lays them for 5 stats side-by-side and randomly picks one for the baby. Here is an example (I used Lucario):
The first Riolu is the case where all IVs transfer perfectly.
The second Riolu is where the Female's SpDef is transfered.
The third Riolu is the case where the IVs of HP, Atk, SpAtk, SpDef, and Spd were transferred leaving the Def IV up to randomly being selected.