I have the following html:
If you want the text within the list items to be centred, try:
ul#menu-utility-navigation {
width: 100%;
}
ul#menu-utility-navigation li {
text-align: center;
}
I don't Know you use any Bootstrap version but the useful helper class for centering and block an element in center it is .center-block
because this class contain margin
and display
CSS properties but the .text-center
class only contain the text-align
property
Bootstrap Helper Class center-block
To make a inline-block element align center horizontally in its parent, add text-align:center
to its parent.
Use display: block;
margin: auto;
it will center the div
You can use flex-grow: 1
. The default value is 0
and it will cause the text-align: center
looks like left
.
https://css-tricks.com/almanac/properties/f/flex-grow/
This worked for me :
e.Row.Cells["cell no "].HorizontalAlign = HorizontalAlign.Center;
But 'css text-align = center '
didn't worked for me
hope it will help you