Shankar,
The difference in rendering is because of the interface used for each example. The 2ndexample you showed (horizontal tabs) is likely a GUI transaction whereas the first example (vertical) is likely a WebDynpro app, etc.
Just create a transaction iView that calls XD02 and you'll see the horizontal alignment.
-Kevin