Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
19737 มุมมอง

Hi,

Could someone please tell me how to center the header of a tree view . I've tried to use a class css with the attribute text-align:center and noted it in the field (xml).

But this didn't work.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Hi,

you can try to do so that was helpful for me

Using selector [data-id="my_field"]====> for a specific th tag and [data-field="my_field"] ====>for specefic td tag

Add the following code in your custom css file

[data-id="my_field"]
{
   /*css properties */  
}

[data-field="my_field"]
{
    /*css properties */
}
อวตาร
ละทิ้ง

Thanks @ ZEeineb

คำตอบที่ดีที่สุด

Hello,

In openerp-web -> addons -> web -> static -> src -> base.css you can find out following class :

.openerp th { font-weight: bold; vertical-align: middle; }

Modify this class by adding : text-align: center;

After modification refresh the browser, The header of tree view is aligned to 'center'.

อวตาร
ละทิ้ง
ผู้เขียน

Thank you for your answer.

ผู้เขียน

The concern is that we apply a CSS style to the whole list so all the titles in this list will be centered or right where the same for all values ​​will be centered or right or left. Can we apply a style for a specefic tree or for specefic titles on the tree? Thank you.

@Hiral Patel, can we change the css alignment only for a particular tree?

It may be possible to apply for particular module by extend particular template, add class to <thead>, but not sure about this.

Related Posts ตอบกลับ มุมมอง กิจกรรม
4
มี.ค. 24
13634
Column width on tree view in Odoo15 แก้ไขแล้ว
1
ก.ค. 22
11513
Inverse of css class oe_edit_only? แก้ไขแล้ว
12
ส.ค. 20
24396
1
มี.ค. 15
12163
0
มี.ค. 15
4086