Skip to Content
Menu
This question has been flagged
1 Reply
5922 Views

I have created a Tree & Form view, the tree view contains 6 columns, the 2nd and 3rd column values are seems in same (single) column, 2nd is Integer and 3rd is a Boolean (checkbox), the integer value align right and Boolean and/or Text type fields align left, how i can control the alignment for the column Headers and column values (on left or right or center as required) so, it can have a good looking Tree view which cannot confuse my users.

please help.

regards

Avatar
Discard
Best Answer

Hello @SmithJohn45

Hope you are doing well,

In Tree View to align column header and it's value,

Please find code in comment. 

I hope this can help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard

Please find code here :-

=> give class name like a "text-right","text-center" or "text-left" (for alignment)
<tree>
<field name="your field name" class="text-right" />
</tree>

OR

=> give inline style to the field inside tree view like below.

<tree>
<field name="your field name" style="text-align: {left/right/center};" />
</tree>

Author

thank you @Jainesh Shah for reply, i used as :
<field name="employee_age" style="text-align: center;" />
but nothing changed, it is an integer type field and still showing Right Aligned (both column header and column values).
regards

Author

please ignore my previous reply, mistakenly i entered the given code in form view, now i am entering in tree view and it is showing errors while i am upgrading the app which i can't understand.
my code is:
<tree string="Employees">
<field name="name"/>
<field name="employee_age" style="text-align:center;"/>
</tree>
regards

Author

this works (thanks a bunch):
<field name="employee_age" class="text-center"/>
but no effect on column header... how i can align column headers separately? as we want all column headers in center but align column values left/right/center as requied?
regards

Related Posts Replies Views Activity
1
Jun 23
1910
1
Apr 25
2276
1
Apr 25
2975
1
Apr 25
671
4
Mar 25
5262