![](https://secure.gravatar.com/avatar/e79f226aa442b589932230491affa641.jpg?s=120&d=mm&r=g)
Hi, a quite basic question, nevertheless I couldn'T find an answer: How do I determine the total with of a TABLE? I though it should be ... \setupTABLE[width=\textwidth] \bTABLE \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \eTABLE ... but this means that all column's INDIVIDUAL width=\textwidth ! But what about the TOTAL width - regardless of the individual column's width? Steffen
![](https://secure.gravatar.com/avatar/b885484dbab8f13188b3f665b24dc448.jpg?s=120&d=mm&r=g)
Steffen Wolfrum wrote:
Hi,
a quite basic question, nevertheless I couldn'T find an answer:
How do I determine the total with of a TABLE?
I though it should be ...
\setupTABLE[width=\textwidth]
\bTABLE \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \bTR \bTD aa \eTD \bTD bb \eTD \bTD cc \eTD \bTD dd \eTD \eTR \eTABLE
... but this means that all column's INDIVIDUAL width=\textwidth !
But what about the TOTAL width - regardless of the individual column's width?
With \setbox: \setbox100=\vbox{% \setupTABLE[...] \bTABLE...\eTABLE% } ht=\the\ht100 , dp=\the\dp100 , wd= \the\wd100 and you can determine the dimensions of your table. But I think you need to setup x dimension, so \setupTABLE[x][width=x\textwidth] where x = 1/number_of_columns (x=0.25 in your example, because you have 4 columns: so you have \setupTABLE[x][width=0.25\textwidth] ) luigi
![](https://secure.gravatar.com/avatar/b885484dbab8f13188b3f665b24dc448.jpg?s=120&d=mm&r=g)
luigi.scarso wrote:
(x=0.25 in your example, because you have 4 columns: so you have \setupTABLE[x][width=0.25\textwidth] )
Of course this setup a TABLE with four columns of equal width and total width =\textwidth; For different width : \setupTABLE[x][1][width=0.2\textwidth] \setupTABLE[x][2][width=0.25\textwidth] \setupTABLE[x][3][width=0.25\textwidth] \setupTABLE[x][4][width=0.3\textwidth] luigi
![](https://secure.gravatar.com/avatar/cedc4d83943006afe3994fb0a0455f82.jpg?s=120&d=mm&r=g)
On Thu, 21 Apr 2005, luigi.scarso wrote:
luigi.scarso wrote:
(x=0.25 in your example, because you have 4 columns: so you have \setupTABLE[x][width=0.25\textwidth] )
Of course this setup a TABLE with four columns of equal width and total width =\textwidth; For different width : \setupTABLE[x][1][width=0.2\textwidth] \setupTABLE[x][2][width=0.25\textwidth] \setupTABLE[x][3][width=0.25\textwidth] \setupTABLE[x][4][width=0.3\textwidth]
Do you know, if this is possible with TABLE: \starttext \SetTableToWidth{10cm} \starttable[|c|c|c|] \HL \VL xxxxxxxxxxxxxxx \VL xxxxxxx \VL x \VL\AR \HL \stoptable \stoptext Cheers, Peter -- http://pmrb.free.fr/contact/
![](https://secure.gravatar.com/avatar/b885484dbab8f13188b3f665b24dc448.jpg?s=120&d=mm&r=g)
Peter Münster wrote:
Do you know, if this is possible with TABLE:
\starttext \SetTableToWidth{10cm} \starttable[|c|c|c|] \HL \VL xxxxxxxxxxxxxxx \VL xxxxxxx \VL x \VL\AR \HL \stoptable \stoptext
Cheers, Peter
Hmm, I change a little your code to better understand it \starttext \SetTableToWidth{10cm} \setbox100=\vbox{\starttable[|c|c|c|] \HL \VL xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx \VL xxxxxxx xxxxxxx \VL x x \VL\AR \HL \stoptable} \starttyping \SetTableToWidth{10cm} \setbox100=\vbox{% \starttable[|c|c|c|] \HL \VL xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx \VL xxxxxxx xxxxxxx \VL x x \VL\AR \HL \stoptable} \stoptyping \type{\wd100=}{\tt \PtToCm{\wd100}}\par \type{\ruledvbox{\unvbox100}:}\par \ruledvbox{\unvbox100} \stoptext and I see on log Overfull \hbox (11.63779pt too wide) in paragraph at lines 14--14 [][]\*12pttttf* \VL[] []xxxxxxxxxxxxxxx[] [][] []xxxxxxxxxxxxxxx[] []\VL[] []xx xxxxx[] []xxxxxxx[] []\VL[] []x[] []x[] []\VL\AR If I fix table width, I must care about cell content to avoid overfull hbox; so fix table width is useless, because I have already calculate by fixing cell content. I will look into natural table to see something similar to \SetTableToWidth luigi
![](https://secure.gravatar.com/avatar/b885484dbab8f13188b3f665b24dc448.jpg?s=120&d=mm&r=g)
Hans Hagen wrote:
Hi,
I'm fighting deadlines right now, but later i'll try to get a look at the current table thread (maybe someone can summarize the problem)
Hans
\SetTableToWidth{10cm} \starttable[|c|c|c|]...\stoptable set width to 10 cm, but if I don't care about cell I can have an overfull box. So the problem seem to be "Can I set the total width of a TABLE using a macros like \setupTABLE[tablewidth=10cm] ?" To solve this problem, I usually set every cell width using \setupTABLE[x][n][width=..]; But with \setupTABLE[tablewidth=...] I will avoid to specify every single cell width, and the TABLE will find the right dimensions. I will look into core-ntb.tex. luigi
participants (3)
-
luigi.scarso
-
Peter Münster
-
Steffen Wolfrum