web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PCF with FluentUI Deta...
Power Apps
Unanswered

PCF with FluentUI Details List - Can't center column header text

(0) ShareShare
ReportReport
Posted on by 293

I am creating a PCF that uses the FluentUI control Details list. I am trying to center the header text of the last column and I can't seem to reach the span that would justify-content for the header text. Can someone help me pinpoint my error?

 

I am using the onRenderDetailsHeader method and I have tried it this way to no avail: 

 

 

 

 

const onRenderDetailsHeader: IRenderFunction<IDetailsColumnProps> = (
 headerProps,
 defaultRender
) => {
 if (!headerProps || !defaultRender) {
 //technically these may be undefined...
 return null;
 }
 return defaultRender({
 ...headerProps,
 styles: {
 root: {
 selectors: {
 ".ms-DetailsHeader-cell": {
 whiteSpace: "normal",
 textOverflow: "clip",
 lineHeight: "normal",
 justifyContent: "center",
 textAlign: "center",
 },
 ".ms-DetailsHeader-cellTitle": {
 height: "100%",
 alignItems: "center",
 justifyContent: "center",
 testAlign: "center",
 },
 },
 },
 },
 });
};

 

 

 

 

Here is my column definition.

 

 

 

 {
 key: "col_failStatus",
 name: "Status",
 ariaLabel: "Pass/Fail Status",
 fieldName: "failStatus",
 minWidth: 70,
 maxWidth: 300,
 onRender: (spec: SpecResult) => (
 <span className={classNames.textDetail}>{spec.failStatus}</span>
 ),
 onRenderHeader: onRenderDetailsHeader,
 },

 

 

 

 

And my details list:

 

 

 <DetailsList
 key={useId("detailsList")}
 items={specs}
 columns={columns}
 selectionMode={SelectionMode.none}
 layoutMode={DetailsListLayoutMode.justified}
 isHeaderVisible={true}
 />

 

 


See the last column in my screenshot:

KASCHN_0-1695054977891.png

 

Here is a screenshot where I centered the column header by changing the justify-content css of a span. I don't know how to reach this span with my code.

KASCHN_0-1695726888951.png

 

 

 

 

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard