Forums

table header formatting

admin_wiky 12 Apr, 2016
Hi all,

how to format title in table header when I want to set text-align: center?
these columns are sortable and I set in column list these paramateres:
oteviracky.po_pa: <div style="text-align:center;">PONDĚLÍ - PÁTEK</div>
oteviracky.so: <div style="text-align:center;">SOBOTA</div>
oteviracky.ne: <div style="text-align:center;">NEDĚLE</div>


but it shows incorrectly
[attachment=0]ScreenShot928.jpg[/attachment]
GreyHead 12 Apr, 2016
Hi homeopat,

The text looks centered to me?

Bob
admin_wiky 13 Apr, 2016
Hi bob,

of course, text is centered, but the ordering buttons arent on same row as header title.
GreyHead 13 Apr, 2016
Hi homeopat,

That's ecause you have added an extra div for the text, using a span with the display as inline block might work, though the text will then be a bit off-centre. You could also add Css to align the whole header cell content.

Bob
admin_wiky 13 Apr, 2016
Yes, I used extra div .. no idea how to center header of table.
I did try modify column list to:

oteviracky.po_pa: <span style="text-align:center;display:inline;">PONDĚLÍ - PÁTEK</span>
oteviracky.so: <span style="text-align:center;display:inline;">SOBOTA</span>
oteviracky.ne: <span style="text-align:center;display:inline;">NEDĚLE</span>


but it didnt take any effect.
admin_wiky 13 Apr, 2016
I did try to modify css
<style>
.gbs3 .th-oteviracky.po_pa {
text-align: center;
}
</style>


in html is element:
<th class="th-oteviracky.po_pa"></th>


but without effect
Maybe I work with bad class?
GreyHead 13 Apr, 2016
Hi homeopat,

Try .gbs3 th { . . .} as the selector, I think that CSS doesn't work with dots in the classes so that is a CC bug.

Bob
This topic is locked and no more replies can be posted.