0

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

1
  • did you try to override the style ? Inspect the generated code, check the classes and styles applied, and override them with the !important property ? In one of my pages I have a <td class="labelCol"> with a width of 18%. Could be a lead... Commented Sep 27, 2017 at 12:11

1 Answer 1

1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .