ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Placing figure inside a table cell, centered
@ 2004-09-15 14:45 Eugene Toporov
  2004-09-16  8:22 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Eugene Toporov @ 2004-09-15 14:45 UTC (permalink / raw)


Hello,

I'm doing a quest. What I intend to do is a table (using Natural
Tables) where one of the columns contains a small icon centered within
the cell with no other data there.

My table looks like this:

\bTABLE
   \bTR   \bTH Operation\eTH \bTH[align=middle] Result\eTH    \eTR 
   \bTR   \bTD HelloWorld! \eTD \bTD[align=middle]
\externalfigure[checkbox] \eTD \eTR
\eTABLE

"align=middle" for TD gives the expected result for the text, but not
for the image.

I've managed to center the image using \midaligned command, like
below. But the table columns width in this case is set to 50% each.
And the only way I found is to add [width=50pt] to each cell.

\bTABLE
   \bTR   \bTH Operation\eTH   \bTH[align=middle][width=50pt]
Result\eTH    \eTR
   \bTR   \bTD HelloWorld! \eTD   \bTD[width=50pt] \midaligned
{\externalfigure[checkbox]} \eTD \eTR
\eTABLE

I'm afraid I make things too complicated. Is there a simpler way to do
what I need?

Thanks a lot.

-- 
Regards.
Eugene Toporov

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

* Re: Placing figure inside a table cell, centered
  2004-09-15 14:45 Placing figure inside a table cell, centered Eugene Toporov
@ 2004-09-16  8:22 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2004-09-16  8:22 UTC (permalink / raw)


Eugene Toporov wrote:

>Hello,
>
>I'm doing a quest. What I intend to do is a table (using Natural
>Tables) where one of the columns contains a small icon centered within
>the cell with no other data there.
>
>My table looks like this:
>
>\bTABLE
>   \bTR   \bTH Operation\eTH \bTH[align=middle] Result\eTH    \eTR 
>   \bTR   \bTD HelloWorld! \eTD \bTD[align=middle]
>\externalfigure[checkbox] \eTD \eTR
>\eTABLE
>
>"align=middle" for TD gives the expected result for the text, but not
>for the image.
>
>I've managed to center the image using \midaligned command, like
>below. But the table columns width in this case is set to 50% each.
>And the only way I found is to add [width=50pt] to each cell.
>
>\bTABLE
>   \bTR   \bTH Operation\eTH   \bTH[align=middle][width=50pt]
>Result\eTH    \eTR
>   \bTR   \bTD HelloWorld! \eTD   \bTD[width=50pt] \midaligned
>{\externalfigure[checkbox]} \eTD \eTR
>\eTABLE
>
>I'm afraid I make things too complicated. Is there a simpler way to do
>what I need?
>  
>
\bTABLE
   \bTR   \bTH Operation\eTH \bTH[align=middle] Result\eTH    \eTR
   \bTR   \bTD HelloWorld! \eTD \bTD[align={middle,hilo}] \noindent\externalfigure[cow][width=10pt] \eTD \eTR
\eTABLE


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2004-09-16  8:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-15 14:45 Placing figure inside a table cell, centered Eugene Toporov
2004-09-16  8:22 ` Hans Hagen

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).