cancel
Showing results for 
Search instead for 
Did you mean: 

Crosstab: Text align in column header DS

11-07-2016 6:28 PM
2388 views 4 comments
0 Likes
SAP Managed Tags
Subscribe

Hi,

I want to Center the column headers of a crosstab, I have already used some CSS but it doesn't change. I have other crosstab with another datasourse and a similar CSS and it works.

At first the problem was that the text was hide column-header.jpg but only the ones of year keep in the same place, I solve it using some code and the final result is this text-alignment-in-header.jpg but the text alignment in center dont work.

Design Studio 16.1.2

This is the CSS I´m using

.sapzencrosstab-ColumnHeaderArea .sapzencrosstab-HeaderCellDefault,  
.sapzencrosstab-ColumnHeaderArea .sapzencrosstab-HeaderCellAlternating,  
.sapzencrosstab-DimensionHeaderArea .sapzencrosstab-HeaderCellAlternating,  
.sapzencrosstab-DimensionHeaderArea .sapzencrosstab-HeaderCellDefault {  
	text-align: center !important ;
	font-weight: Bold;
	border-collapse: collapse;
	color: white;
	background-image: none !important;  
        background-color: #0060ae !important; 
	border-left: none;
	border-right:  1px solid white;
	border-bottom: 2px solid white;
	font-size: 14px;
	height: 17px;
}  
.crosstab .sapzencrosstab-DataArea td {
	background-color: #D3D3D3;
	border-collapse: collapse;
	border-color: transparent;
	font-size: 14px;
	border-left: none;
	height: 17px ;
	color: black;
	line-height: 17px;
}
.crosstab .sapzencrosstab-RowHeaderArea td {
	text-align: Center !important;
	background-color: #D3D3D3; 
	border-collapse: collapse;
	border-color: transparent;
	font-size: 14px !important;
	font-weight: normal;
	border-right-width: 3px;
	border-right-color: white;
	height: 17px ;
	vertical-align: top;
	color: black;
	line-height: 17px;
}
.crosstab .sapzencrosstab-HeaderCellContentDiv { 
 	margin-top: 0px; 
	height: 17px; 
	line-height: 17px; 	
 }  
.crosstab .sapzencrosstab-HeaderCellDivHierarchy { 
        width: 0px;  
 	height: 0px;  
 	margin-right: 0px; 
 	margin-left: 0px; 
 } 

0 Likes

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Hi Maria,

The code given by Tammy is working for me, I think you may have enabled sorting in cross tab, It will not work then.

Disable the sorting and apply css.

Thanks,

Poovarasan

TammyPowlas
SAP Mentor
SAP Mentor
0 Likes

What if you removed the font size and height? What theme are you using?

This is working for me:

.sapzencrosstab-DimensionHeaderArea .sapzencrosstab-HeaderCellDefault, .sapzencrosstab-ColumnHeaderArea .sapzencrosstab-HeaderCellDefault
{
white-space: normal;
word-wrap: break-word;
color:white;
text-align: center;


}
Former Member
0 Likes

I'm using mobile theme,

This is the result without height and font size : without-height.jpg

I used the code above but it doesnt work

TammyPowlas
SAP Mentor
SAP Mentor
0 Likes

Did you try what Poovarasan suggested below "Disable the sorting and apply css"