ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* three more table questions
@ 2011-04-11 10:44 Florian Wobbe
  2011-04-11 10:53 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Wobbe @ 2011-04-11 10:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

1) how can I auto-stretch a natural table to a defined width? The default seems to be the line width, which I don't want. Setting width=... will change the per column width, which I don't like either. I'd like to set the per table width.

\bTABLE[option=stretch,width=80mm]
\bTABLEhead
\bTR \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR}
\eTABLEbody
\eTABLE

Or is there maybe the possibility to enforce a certain with with \placetable?

2) In this example I'd like to have no offset between lines but an offset between columns. How can I achieve this without the gaps in the hline separating the header?

\bTABLE
\setupTABLE[frame=off,offset=0pt]
\setupTABLE[c][distance=3mm]
\bTABLEhead
\bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR}
\eTABLEbody
\eTABLE

I also tried various combinations of offset=, columndistance=, leftmargindistance=, and rightmargindistance= for columns and rows but did not succeed.

3) Consider this example:

\bTABLE[option=stretch]
\setupTABLE[frame=off,offset=0pt]
\bTABLEhead
\bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD this is a long entry \eTD \eTR}
\eTABLEbody
\eTABLE

Is it possible to auto-stretch only the first three columns, so that "this is a long entry" is always aligned to the right margin? All columns should stay flushleft.

Thanks!
Florian

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: three more table questions
  2011-04-11 10:44 three more table questions Florian Wobbe
@ 2011-04-11 10:53 ` Wolfgang Schuster
  2011-04-11 11:42   ` Florian Wobbe
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2011-04-11 10:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 11.04.2011 um 12:44 schrieb Florian Wobbe:

> Hi,
> 
> 1) how can I auto-stretch a natural table to a defined width? The default seems to be the line width, which I don't want. Setting width=... will change the per column width, which I don't like either. I'd like to set the per table width.
> 
> \bTABLE[option=stretch,width=80mm]
> \bTABLEhead
> \bTR \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
> \eTABLEhead
> \bTABLEbody
> \dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR}
> \eTABLEbody
> \eTABLE
> 
> Or is there maybe the possibility to enforce a certain with with \placetable?

Use \bTABLE[option=stretch,textwidth=\textwidth].

> 2) In this example I'd like to have no offset between lines but an offset between columns. How can I achieve this without the gaps in the hline separating the header?
> 
> \bTABLE
> \setupTABLE[frame=off,offset=0pt]
> \setupTABLE[c][distance=3mm]
> \bTABLEhead
> \bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
> \eTABLEhead
> \bTABLEbody
> \dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR}
> \eTABLEbody
> \eTABLE
> 
> I also tried various combinations of offset=, columndistance=, leftmargindistance=, and rightmargindistance= for columns and rows but did not succeed.

\setupTABLE[start]        [loffset=3mm,roffset=3mm]
\setupTABLE[column][first][loffset=0mm]
\setupTABLE[column][last] [roffset=0mm]

> 3) Consider this example:
> 
> \bTABLE[option=stretch]
> \setupTABLE[frame=off,offset=0pt]
> \bTABLEhead
> \bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
> \eTABLEhead
> \bTABLEbody
> \dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD this is a long entry \eTD \eTR}
> \eTABLEbody
> \eTABLE
> 
> Is it possible to auto-stretch only the first three columns, so that "this is a long entry" is always aligned to the right margin? All columns should stay flushleft.

You can exclude columns from stretching when you set a width, e.g. \setupTABLE[column][last][width=4cm,align=flushright]

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: three more table questions
  2011-04-11 10:53 ` Wolfgang Schuster
@ 2011-04-11 11:42   ` Florian Wobbe
  2011-04-11 13:02     ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Wobbe @ 2011-04-11 11:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>> 3) Consider this example:
>> 
>> \bTABLE[option=stretch]
>> \setupTABLE[frame=off,offset=0pt]
>> \bTABLEhead
>> \bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
>> \eTABLEhead
>> \bTABLEbody
>> \dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD this is a long entry \eTD \eTR}
>> \eTABLEbody
>> \eTABLE
>> 
>> Is it possible to auto-stretch only the first three columns, so that "this is a long entry" is always aligned to the right margin? All columns should stay flushleft.
> 
> You can exclude columns from stretching when you set a width, e.g. \setupTABLE[column][last][width=4cm,align=flushright]

Thanks again for your suggestions! Still I have problems with the last column, which should be flushleft, exactly as wide as the containing text, and still aligned to the right page margin (the frame in this case).

I experimented:

\framed{
\bTABLE[option=stretch]
\setupTABLE[frame=off,offset=0pt]
\setupTABLE[column][last][width=2mm] % here is the difference
\bTABLEhead
\bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD \blackrule[height=5pt, width=30mm] \eTD \eTR}
\eTABLEbody
\eTABLE}

\framed{
\bTABLE[option=stretch]
\setupTABLE[frame=off,offset=0pt]
\setupTABLE[column][last][width=30mm] % here is the difference
\bTABLEhead
\bTR[bottomframe=on] \bTD Col1 \eTD \bTD Col2 \eTD \bTD Col3 \eTD \bTD Col4 \eTD \eTR
\eTABLEhead
\bTABLEbody
\dorecurse{5}{\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD \blackrule[height=5pt, width=30mm] \eTD \eTR}
\eTABLEbody
\eTABLE}

In this case I know the last column width (30mm) but the output is unpredictable.

In case I don't know the text width, is there a way to get a dummy width equal to \settowidth (latex)?

Florian

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: three more table questions
  2011-04-11 11:42   ` Florian Wobbe
@ 2011-04-11 13:02     ` Aditya Mahajan
  2011-04-11 13:18       ` Florian Wobbe
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2011-04-11 13:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 11 Apr 2011, Florian Wobbe wrote:

> In case I don't know the text width, is there a way to get a dummy width equal to \settowidth (latex)?

Search the list archive. Hans has posted a solution sometime back.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: three more table questions
  2011-04-11 13:02     ` Aditya Mahajan
@ 2011-04-11 13:18       ` Florian Wobbe
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Wobbe @ 2011-04-11 13:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>> In case I don't know the text width, is there a way to get a dummy width equal to \settowidth (latex)?
> 
> Search the list archive. Hans has posted a solution sometime back.

Thanks, I found it: http://archive.contextgarden.net/message/20070314.120612.adab0a8b.en.html
Would make a useful core function...

Florian

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-11 13:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-11 10:44 three more table questions Florian Wobbe
2011-04-11 10:53 ` Wolfgang Schuster
2011-04-11 11:42   ` Florian Wobbe
2011-04-11 13:02     ` Aditya Mahajan
2011-04-11 13:18       ` Florian Wobbe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).