Or just use the thinnest slab with one being white for the pillow. Works equally as well, especially for bunk beds. Just gotta make sure you have something to attach them to like thin slabs at the front and back or a wall or something.Best use of slabs aside from the obvious things like tables that I've found, beds.
Use colored standard armor 3/4 slabs as the bed, and then a full height white at the head. Instant bed with pillow!