Generalright-justify in table

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
bill
Posts: 8
Joined: Sat May 10, 2008 10:33 am

right-justify in table

Post by bill »

In the attached invoice latex file. I want to right-justify the four "1,000". It that possible with supertabular?

thanks in advance.
Attachments
sam.tex
(3.96 KiB) Downloaded 320 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

right-justify in table

Post by Stefan Kottwitz »

Hi Bill,

you could insert \raggedleft, for example:

Code: Select all

\begin{supertabular}{|m{0.8587598in}|m{4.35876in}|>{\raggedleft}
m{0.8587598in}|>{\raggedleft\arraybackslash}m{0.9316599in}|}
Stefan
LaTeX.org admin
bill
Posts: 8
Joined: Sat May 10, 2008 10:33 am

Re: right-justify in table

Post by bill »

Thank you. The invoice looks OK now.

Another question. what is the meaning of the ">" in front of the {ragedgleft group?

regards,
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

right-justify in table

Post by Stefan Kottwitz »

Hi Bill,
bill wrote:what is the meaning of the ">" in front of the {ragedgleft group?
It inserts the command inside the following braces directly before the entry of the column. You can use it for formatting the entries. For instance if you write >{$}c<{$} instead of c for a tabular environment you will get a column in math mode. It is described by the array package documentation if you want to read further.

Stefan
LaTeX.org admin
bill
Posts: 8
Joined: Sat May 10, 2008 10:33 am

Re: right-justify in table

Post by bill »

Thank you for pointer. However, for the same invoice, how to make the caption cells (quantity/description/price/amount) to have 10% gray background?

regards,
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

right-justify in table

Post by Stefan Kottwitz »

Hi Bill,

have a look at the colortbl package, by using that package you can color cells or rows/ columns. I am not sure if its working together with supertabular, but you could try it.

Stefan
LaTeX.org admin
bill
Posts: 8
Joined: Sat May 10, 2008 10:33 am

Re: right-justify in table

Post by bill »

It seems to study a new package. Need more time to learn.

Tank you.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: right-justify in table

Post by Stefan Kottwitz »

It's easier to read a package documentation and use the provided features instead of programming it yourself. ;)
There's a lot of packages for many purposes, using them as ready-made solutions usually saves time and gives good results.

Stefan
LaTeX.org admin
Post Reply