Changing the styling (layout) of you application based on the orientation of a device can be done with the help of media queries in css.
An explanation and example can be found on: https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Managing_screen_orientation
Hope this helps you in finding a solution for your requirements.