Even in slide in campers for pick up trucks, the table is actually the base for a bed, it fits between the seats and makes a larger or 3rd bed connecting the 2 seats on the sides which are used as beds.
If you spend some time planning, you can really make wasted space usable in surprising ways like the storage is also the steps to the loft...ect... Hidden storage in floors and walls.