Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

horizontal padding/spacing in tabular*

2,097 views
Skip to first unread message

Justin C

unread,
Jul 15, 2008, 9:35:45 AM7/15/08
to
I've just started looking at using LaTeX to produce a multi-page
price-list. It looks promising.

A problem I do have, so far, though, is the spacing within cells in a
tabular* table. There is more padding around the left and right edges
than I want. I've Googled this and can't find a setting for it anywhere.

Thank you for any suggestions.

Justin.

--
Justin C, by the sea.

Werner Grundlingh

unread,
Jul 15, 2008, 12:56:01 PM7/15/08
to

You can change the tabular cell spacing in the whole document by
change the length of the parameter \tabcolsep. Naturally, this command
contains the separation between columns in a tabular environment. More
specifically, this change may be made by means of the command
\setlength{\tabcolsep}{5ex}
where the last (5ex in this case) is any valid LaTeX measurement (for
example, 1em, 20pt, 2mm, 5cm, etc). You will be able to see the
effects by compiling the following minimal LaTeX example:

\documentclass{article}

\usepackage{lipsum}

\begin{document}

\setlength{\tabcolsep}{5ex}

\begin{tabular}{|p{0.3\textwidth}|p{0.3\textwidth}|p{0.3\textwidth}|}
\lipsum[1] & \lipsum[2] & \lipsum[3]
\end{tabular}

\end{document}

Justin C

unread,
Jul 16, 2008, 4:09:21 AM7/16/08
to
On 2008-07-15, Werner Grundlingh <wgrun...@gmail.com> wrote:
> On Jul 15, 6:35 am, Justin C <justin.0...@purestblue.com> wrote:
>> I've just started looking at using LaTeX to produce a multi-page
>> price-list. It looks promising.
>>
>> A problem I do have, so far, though, is the spacing within cells in a
>> tabular* table. There is more padding around the left and right edges
>> than I want. I've Googled this and can't find a setting for it anywhere.
>
> You can change the tabular cell spacing in the whole document by
> change the length of the parameter \tabcolsep. Naturally, this command
> contains the separation between columns in a tabular environment. More
> specifically, this change may be made by means of the command
> \setlength{\tabcolsep}{5ex}
> where the last (5ex in this case) is any valid LaTeX measurement (for
> example, 1em, 20pt, 2mm, 5cm, etc). You will be able to see the
> effects by compiling the following minimal LaTeX example:

That's great, thank you.

I'm very new to TeX... so new that this is my first project. The problem
I have is that the project is a big one! I've spent a lot of time with
Google, and the (La)Tex documentation I have been able to find, but the
learning curve is a steep one. I really appreciate the help.

Werner Grundlingh

unread,
Jul 16, 2008, 12:42:25 PM7/16/08
to
On Jul 16, 1:09 am, Justin C <justin.0...@purestblue.com> wrote:
> That's great, thank you.
>
> I'm very new to TeX... so new that this is my first project. The problem
> I have is that the project is a big one! I've spent a lot of time with
> Google, and the (La)Tex documentation I have been able to find, but the
> learning curve is a steep one. I really appreciate the help.
>
>         Justin.

Justin,

In that sense, news groups are a good way to exchange ideas and get
feedback from a variety of sources. Apart from this news group,
another called comp.text.tex has been around for almost 2 decades, and
regularly has more than 2000 posts a month ~ 70 posts a day, ranging
from novice to extremely advanced/technical LaTeX questions.
Performing a search on comp.text.tex typically reveals solved problems
similar to yours.

Just a way of spreading the LaTeX knowledge...
Werner

Werner Grundlingh

unread,
Jul 16, 2008, 12:43:54 PM7/16/08
to

...I meant to say LaTeX Users Group...this _is_
comp.text.tex...whoops! LaTeX Users Group doesn't receive as many
posts as comp.text.tex, only about 1/day...

Werner

0 new messages