Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-10-16 13:18:34

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

[textile] colgroup

hi,

i need 3-column table: total width 100%, first column width 35%, second 15% and last column 50%.

how this code below should then look like?

|:\3. 100|35|15|50|

can’t figure it out… :(

Last edited by Gallex (2014-10-16 13:19:38)

Offline

#2 2014-10-16 13:45:32

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: [textile] colgroup

like this? is it correct?

|:\3. |350|150|500|

Offline

#3 2014-10-16 17:49:28

etc
Developer
Registered: 2010-11-11
Posts: 5,192
Website GitHub

Re: [textile] colgroup

Have you tried this?

|:\3. |{width:35%}|{width:15%}|{width:50%}|

Offline

#4 2014-10-20 07:14:31

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: [textile] colgroup

if my code is correct, i would like to use mine – it’s simplier for user. is it?

Offline

#5 2014-10-20 09:50:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: [textile] colgroup

Gallex wrote #284968:

if my code is correct, i would like to use mine

As far as I can tell, your code |:\3. |350|150|500| is correct.

Textile’s colgroup doesn’t support percent widths (at least, not without resorting to inline styles as etc suggests). You could check the Textile project to see if it’s been implemented in a development branch, but since the width attribute doesn’t appear to be supported in HTML 5 (presumably, CSS is the way to go), it’s unlikely to appear.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2014-10-20 11:53:36

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: [textile] colgroup

maybe then we should not to suggest using it in colgroup element? example 7

|:\3. 100 |{background:#ddd}|250||50|300|

this row is quite confusing for me also… 5 columns in total? first column is 100px wide?

Offline

#7 2014-10-20 12:36:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: [textile] colgroup

Gallex wrote #284976:

this row is quite confusing for me also… 5 columns in total? first column is 100px wide?

The tables article explains it well. In a nutshell, the first number is the number of columns to span, the next is the overall width, and any individual numbers in each cell are the widths (in px) of that particular column.

Note that the HTML spec mandates that you should not use a span on the colgroup if you specify individual col entries, so omit the span value in those cases, e.g. |:. |250||300| to add 3 cols, the middle of which has auto width. You can also span individual columns:

|:. 750|(firstcol). |\2. 250||300|

which becomes:

<colgroup width="750">
   <col class="firstcol" />
   <col span="2" width="250" />
   <col />
   <col width="300" />
</colgroup>

The 100 in your example isn’t strictly necessary since your remaining widths add up to more than 100… but then the example on txstyle depicts that too, so should probably be changed; as well as removing reference to sitemonks.com which is now defunct. Feel free to contact the owner of the site and ask if they would update it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2014-10-20 12:49:45

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: [textile] colgroup

thank’s bloke

Offline

Board footer

Powered by FluxBB