Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

10

What is the different between col and colspan?

By
More9ike
on 2/14/13, 8:07 AM 11,351 views

What's the difference between col and colspan and how to use then in OpenERP?

This question has been included in the official documentation.
29

tolstoj

--tolstoj--
899
| 6 5 8
Germany
--tolstoj--

hi

tolstoj
On 2/14/13, 8:16 AM

Every form view container (form itself, group, page, I think there are more) in OpenERP consists of 4 columns to start with.

<form>
┌───┬───┬───┬───┐
│ 1 │ 2 │ 3 │ 4 │
└───┴───┴───┴───┘
</form> 

Every <field> takes 2 columns: label & input field

<field name="input" />
<field name="inpt2" />
┌───────┬───────┬───────┬───────┐
│ label │ input │ labl2 │ inpt2 │
└───────┴───────┴───────┴───────┘ 

With colspan, you can widen items.

<field name="inpt4" colspan="4"/>
<field name="input" />
<field name="inpt2" />
┌───────┬───────────────────────┐
│ labl4 │ inpt4_______________  │
├───────┼───────┬───────┬───────┤
│ label │ input │ labl2 │ inpt2 │
└───────┴───────┴───────┴───────┘

<field name="input" />
<field name="inpt4" colspan="4"/>
<field name="inpt2" />

┌───────┬───────┬───────┬───────┐
│ label │ input │       │       │
├───────┼───────┴───────┴───────┤
│ labl4 │ inpt4_______________  │
├───────┼───────┬───────┬───────┤
│ labl2 │ inpt2 │       │       │
└───────┴───────┴───────┴───────┘ 

When you add additional containers, like a page, you can tell OpenERP to use more or less columns.

<group col="2" colspan="2">
    <field name="a" />
    <field name="b" />
</group>
<group col="6" colspan="2">
    <field name="d" />
    <field name="e" />
    <field name="f" />
</group>
│       │       │                │                │
├───────┴───────┼────────────────┴────────────────┤
│ ┌────┬───┐    │  ┌────┬───┬────┬───┬────┬───┐   │
│ │ lb │ a │    │  │ lb │ d │ lb │ e │ lb │ f │   │
│ ├────┼───┤    │  └────┴───┴────┴───┴────┴───┘   │
│ │ lb │ b │    │                                 │
│ └────┴───┘    │                                 │
├───────┬───────┼────────────────┬────────────────┤
│       │       │                │                │
  

source

good answer. Just changed your answer, it's col, not cols

Fabien Pinckaers (fp)
on 2/14/13, 8:29 AM

good job (Y)

morad
on 11/8/13, 11:17 AM

tolstoj , could you update your answer. It seems that special character had been broken after updates of this site. I can see only something like that: ”œâ”€â”€â”€â”€â”€â”€â”€â”´â”

Ivan Yelizariev
on 10/30/14, 11:34 AM

I fixed the answer based on archive.org page: https://web.archive.org/web/20140215040610/http://help.openerp.com/question/1490/what-is-the-different-between-col-and-colspan

Mohammad Alhashash
on 6/11/15, 7:15 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 2/14/13, 8:07 AM
Seen: 11351 times
Last updated: 7/15/16, 11:48 PM