Graphics, Figures & TablesUnusual Table Shape

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Nihil[CL]
Posts: 2
Joined: Wed Feb 20, 2013 12:19 am

Unusual Table Shape

Post by Nihil[CL] »

Hello,
I'm a new user of latex and I'm having some serious issues trying to make a table, so far I have this:

Code: Select all

\begin{center}
\scalebox{0.7}{%
\begin{tabular}{c|c|c|c|c|c}
\multicolumn{1}{c}{}&
\multicolumn{4}{|c|}{Calidad firma j}\\
\hline
&1 & 2 & $\cdots$ & $\rho^{max}$ \\
\hline
1&$1,00$ $1,00$ &$R\pi_i(1,2) R\pi_j(2,1)$&$\cdots $&$R\pi_i(1,\rho^{max}) R\pi_j(\rho^{max},1)$ \\
\hline
2&$R\pi_i(2,1) R\pi_j(1,2)$&$1,00$ $1,00$ &$\cdots $&$R\pi_i(2,\rho^{max}) R\pi_j(\rho^{max},2)$ \\
\hline
$\vdots$&$\cdots$&$\cdots$&$\cdots$&$\cdots$ \\
\hline
$\rho^{max}$&$R\pi_i(\rho^{max},1) R\pi_j(1,\rho^{max})$&$R\pi_i(\rho^{max},2) R\pi_j(2,\rho^{max})$& $\cdots $& $1,00$ $1,00$ \\
\hline
\end{tabular}}
\end{center}
And it should be like the image below. I'll appreciate any advice, thanks.
Attachments
how it should looks like
how it should looks like
Cuadro.png (8.58 KiB) Viewed 4912 times

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Unusual Table Shape

Post by mas »

There is nothing unusual about the shape of the table. It is still a rectangular box :)

It would be better if you post a compilable example like a Infominimal working example rather than just the fragment you are working on.

I am posting my attempt which reprodcues what you want. You can use tabularx or tabulary packages to get the desired widths for your columns and rows.

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\usepackage{multirow}

\begin{document}
\begin{center}
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{|c|c|c|c|c|c|}
  \cline{3-6} 
  \multicolumn{1}{c}{} & & \multicolumn{4}{|c|}{Calidad Firma} \\ \cline{3-6}
  \multicolumn{1}{c}{} & & 1 & 2 & \ldots & $\rho^{\mathrm max}$ \\ \hline  
  \multirow{4}{2em}%
  {\rotatebox{-90}{Calidad Firma}} 
  & 1 & 1,00 & aa & bb & cc  \\ \cline{2-6}
  & 2 & 1,00 & aa & bb & cc  \\ \cline{2-6}
  & $\vdots$ & 1,00 & aa & bb & cc \\ \cline{2-6}
  & $\rho^{\mathrm max}$ & 1,00 & aa & bb & cc  \\ \hline
\end{tabular}
\end{center}
\end{document}
The output:
y.png
y.png (15.15 KiB) Viewed 4904 times
Regards.

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Unusual Table Shape

Post by svend_tveskaeg »

This looks fine, except that

(1) \mathrm max should be \max and
(2) it is better to use

Code: Select all

\begin{table}
\centering
...
\end{table}
than

Code: Select all

\begin{center}
...
\end{center}
The first construction gives the correct vertical spacing around the table.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Nihil[CL]
Posts: 2
Joined: Wed Feb 20, 2013 12:19 am

Re: Unusual Table Shape

Post by Nihil[CL] »

Thanks for the help, ill be more careful posting the code the next time. Thanks again mas and svend I really appreciate it.
Post Reply