Article View: comp.text
Article #5967Re: centering tables
From: Greg McGary
Date: Fri, 10 Mar 1989 14:39
Date: Fri, 10 Mar 1989 14:39
30 lines
1562 bytes
1562 bytes
In article <601@sunset.MATH.UCLA.EDU> adam@MATH.UCLA.EDU () writes:
>How do you center a table? For example, the ATT stock table on
>page 247 of the Texbook. I tried \centerline and this sort of
>works depending on the \halign to dimen parameter.
One of the easiest way to accomplish this is to exploit `display math'
mode.
$$\vbox{\halign{<preamble>\cr
<table-body>\cr}}$$
This centers the \vbox and puts some extra space above and below.
If you don't want the extra verticle space, you can do this:
\centerline{\vbox{\halign{<preamble>\cr
<table-body>\cr}}}
Alternatively, you can do `\halign to\hsize' to make the \halign
expand to the width of the page, then you'll have to add infintely
stretchable glue before the first column and after the last column.
To learn how to set \tabskip glue, I'll refer you to pages 237, 238
in the TeXbook.
Good Luck!
-- Greg McGary
-- 4201 University Drive #102, Durham, NC 27707 voice: (919) 490-6037
-- {decvax,hplabs,seismo,mcnc}!duke!gm data: (919) 493-5953
-- gm@cs.duke.edu
Technical Details
Message-ID:
<13814@duke.cs.duke.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!gatech!mcnc!duke!romeo!gmReferences:
<601@sunset.MATH.UCLA.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!gatech!mcnc!duke!romeo!gm From: gm@romeo.cs.duke.edu (Greg McGary) Newsgroups: comp.text Subject: Re: centering tables Message-ID: <13814@duke.cs.duke.edu> Date: 10 Mar 89 14:39:41 GMT References: <601@sunset.MATH.UCLA.EDU> Sender: news@duke.cs.duke.edu Reply-To: gm@romeo.UUCP (Greg McGary) Distribution: usa Organization: Duke University CS Dept.; Durham, NC Lines: 30