[SalesForce] Visualforce page inputfield label formatting

I am not sure how to avoid the line break in the label. For example on the field "Is this Overall Parent Company" , I am expecting the label to be in one line. I tried with style but no success.

    <apex:page id="ExecutiveSnapshotCalculation" standardController="Executive_Snapshot__c" extensions="ExecSnapshotCalculations"
           lightningStylesheets="{!$User.UIThemeDisplayed == 'Theme4d'}">
    <style type="text/css">
        .fieldClass {
            padding-top: 2px;
            padding-right: 10px;
            padding-bottom: 2px;
            padding-left: 2px;
            text-align: right;
            font-size: 91%;
            font-weight: bold;
        }
    </style>
    <apex:form id="ExecSS">
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton value="Submit Request" action="{!doSave}"/>
                <apex:commandButton value="Cancel" action="{!back}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection id="companydata" columns="1" title="Company Data" collapsible="false">
                <apex:outputText value="{!$Label.ExecSS_Description}" style="float:right;font-weight:300" styleClass="label"/>
                <apex:pageBlockSection columns="2">
                    <apex:pageBlockSection id="companysectionleft" columns="1" >
                        <apex:inputField value="{!Executive_Snapshot__c.Company_Name__c}" required="true" id="Company_Name__c" />
                        <apex:inputField value="{!Executive_Snapshot__c.Overall_Parent_Company__c}" required="false" id="Overall_Parent_Company__c"/>
                        <apex:inputField value="{!Executive_Snapshot__c.Total_Revenue__c}" required="false" id="Total_Revenue__c" />
                        <apex:inputField value="{!Executive_Snapshot__c.Total_Assets__c}" required="false" id="Total_Assets__c"/>
                        <apex:inputField value="{!Executive_Snapshot__c.Market_Cap__c}" required="false" id="Market_Cap__c"/>
                        <apex:inputField value="{!Executive_Snapshot__c.Number_of_Employees__c}" required="false" id="Number_of_Employees__c"/>
                        <apex:inputField value="{!Executive_Snapshot__c.Ownership_Governance__c}" required="false" id="Ownership_Governance__c"/>
                        <apex:inputField value="{!Executive_Snapshot__c.Sector_of_Operations__c}" required="false" id="Sector_of_Operations__c"/>
                        <apex:inputField value="{!Executive_Snapshot__c.Percent_of_Business__c}" required="false" id="Percent_of_Business__c"/>
                    </apex:pageBlockSection>
                    <apex:pageBlockSection id="companysectionright" columns="1">
                        <apex:outputText value="If the company is not the overall Parent company, complete the following:" style="float:left;font-weight:600" styleClass="label"/>
                            <apex:inputField value="{!Executive_Snapshot__c.Parent_Company_Name__c}" required="false" id="Parent_Company_Name__c" />
                            <apex:inputField value="{!Executive_Snapshot__c.Parent_Total_Revenue__c}" required="false" id="Parent_Total_Revenue__c"/>
                            <apex:inputField value="{!Executive_Snapshot__c.Parent_Total_Assets__c}" required="false" id="Parent_Total_Assets__c"/>
                            <apex:inputField value="{!Executive_Snapshot__c.Parent_Market_Cap__c}" required="false" id="Parent_Market_Cap__c"/>
                            <apex:inputField value="{!Executive_Snapshot__c.Parent_Number_Of_Employees__c}" required="false" id="Parent_Number_Of_Employees__c"/>
                            <apex:inputField value="{!Executive_Snapshot__c.Parent_Ownership__c}" required="false" id="Parent_Ownership__c"/>
                            <apex:inputField value="{!Executive_Snapshot__c.Parent_Sector_of_Operations__c}" required="false" id="Parent_Sector_of_Operations__c"/>
                            <apex:inputField value="{!Executive_Snapshot__c.Parent_Percent_of_Business__c}" required="false" id="Parent_Percent_of_Business__c"/>
                    </apex:pageBlockSection>
                </apex:pageBlockSection>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Job/Position Data" collapsible="false">
                <apex:pageBlockSection id="jobsectionleft" columns="1">
                    <apex:outputText value="Please provide the following information on the role / position needed:" style="float:left;font-weight:600" styleClass="label"/>
                    <apex:inputField value="{!Executive_Snapshot__c.Client_Position_Title__c}" required="false" id="Client_Position_Title__c"/>
                    <apex:inputField value="{!Executive_Snapshot__c.Country__c}" required="false" id="Country__c"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection id="jobsectionright" columns="1">
                    <apex:inputField value="{!Executive_Snapshot__c.Reporting_Level__c}" required="false" id="Reporting_Level__c"/>
                    <apex:inputField value="{!Executive_Snapshot__c.Function__c}" required="false" id="Function__c"/>
                    <apex:inputField value="{!Executive_Snapshot__c.Job_Match__c}" required="false" id="Job_Match__c"/>
                </apex:pageBlockSection>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

enter image description here

Best Answer

I was able to resolve this. After inspecting the code in the browser added the style to avoid the wrap.

<style type="text/css">
    .bPageBlock th.vfLabelColTextWrap {
      white-space: nowrap;   //added nowrap here
      position: relative;
    }
</style>

enter image description here

Related Topic