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;
}
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.