change columns="X", X is integer with no of columns which will include the fields and shows horizontally. Or you can use <apex:column headerValue="column name"> <apex:inputField value="{!x.y__c}" required="true"/> </apex:column> Mark as best answer if it helps. Thanks.
in your pageblocksection give as a columns="4" so you can see horizontally.
for more informatin please visit https://www.etggs.com/services/salesforce/ (https://www.etggs.com/services/salesforce/" style="color:#0563c1; text-decoration:underline)...
Or
you can use <apex:column headerValue="column name">
<apex:inputField value="{!x.y__c}" required="true"/>
</apex:column>
Mark as best answer if it helps.
Thanks.