I have the code below and it prints checkbox and a text below it. I want the text to be printed next to the checkbox on the same line:
echo VmHtml::checkbox ('STsameAsBT', $this->cart->STsameAsBT,1,0,'id="STsameAsBTjs" data-dynamic-update=1') . vmText::_ ('COM_VIRTUEMART_USER_FORM_ST_SAME_AS_BT');
So apparently you are using virtuemart, which is a commerce extension for Joomla. Like many advanced extensions, it is quite complicated, and has an entire subsystem of code.
For example, Virtuemart has its own template system which can be used to change the look of the virtuemart pages within the system.
Templates have their own style sheets which can be used to style the individual elements.
At the end of the day your code is simply outputting html, and the html is being styled by the css and javascript that is included on the page.
You'll need to inspect the html and css and determine why you are not getting the behavior you want, and modify that css within the appropriate css file that is part of the virtuemart template.
In summary, you are looking in the wrong place. The php code is going to output the html markup, and you are not going to fix style issues in the php code but rather in the css file(s) which style that markup.