GeneralHow to make parbox center in table?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
aaron792
Posts: 5
Joined: Wed May 07, 2008 10:47 am

How to make parbox center in table?

Post by aaron792 »

I want the first row of this table, supposed to be placed at one columne of a two-cloumn formatted text, to be centered and add some space to it at the top and the bottom.
Image
The code:

Code: Select all

\begin{table}[h]
\centering
\caption{1-9 Scales definition.}
\begin{tabular}{p{1.5cm}p{2.3cm}p{2.3cm}}
  \hline
   Relative intensity & Definition & Explanation in weight comparison example} \\
  \hline
  1 & Equal importance & Equal weights \\
  3 & Moderat importance & Weight ratio=3/2 \\
  5 & Strong importance & Weight ratio=2\\
  7 & Very strong importance & Weight ratio=3\\
  9 & Extreme importance & Weight ratio\ge5\\
  2,4,6,8 & Intermediat values between two adjacent judgments & Intermediate weight ratios of above \\
  \hline
\multicolumn{3}{p{7.5cm}}{Reciprocals if activity $i$ has one of the above numbers assigned to it when compared with activity $j$, then $j$ has the reciprocal value when compared with $i$}
\label{tab:1}
\end{tabular}
\end{table}
Why can't I defined a centered box at the definition of the table format?

Code: Select all

\begin{tabular}{p{1.5cm}p{2.3cm}p{2.3cm}}
When I try to use

Code: Select all

\begin{tabular}{m{1.5cm}m{2.3cm}m{2.3cm}}
This table streches to two columns. What should I do? :shock:

Recommended reading 2024:

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

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

aaron792
Posts: 5
Joined: Wed May 07, 2008 10:47 am

How to make parbox center in table?

Post by aaron792 »

Problem is solved.
use

Code: Select all

\begin{tabular}{ccc}
to get text or box centered.
use

Code: Select all

\rule{0pt}{1cm}
to add top spacing.
use

Code: Select all

\vspace{0.1cm}
to add bottom spacing.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to make parbox center in table?

Post by localghost »

There would have been much better solutions. Take a look at the array package.


Best regards
Thorsten
Post Reply