dp alignment with javascript