Skip to Content
avatar image
Former Member

Crosstab: Text align in column header DS

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; 
 } 

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 07, 2016 at 05:48 PM

    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;
    
    
    }
    
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 08, 2016 at 04:22 PM

    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

    Add comment
    10|10000 characters needed characters exceeded