Graphics, Figures & TablesHelp in table formatting

Information and discussion about graphics, figures & tables in LaTeX documents.
rajini
Posts: 64
Joined: Mon Mar 22, 2010 2:27 pm

Re: Help in table formatting

Post by rajini »

Hi both of you,
gmedia's last post is extremely useful..and i am happy to get what i need..

thanks a lot
rajini

Ps. these hints are not shown in any internet pages,,so i was bugging you guys..

Recommended reading 2024:

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

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

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Re: Help in table formatting

Post by php1ic »

http://en.wikibooks.org/wiki/LaTeX/Tabl ... tiple_rows

If you are a beginner (or even if you are not), I have found the above website and it's explanations and examples very helpful.

Also, you'll be amazed at what you pick up by simply read threads on the forum.
xana
Posts: 14
Joined: Mon May 31, 2010 5:31 am

Re: Help in table formatting

Post by xana »

Hello.

I have maked a table like you suggested. My problem is that if the content {text text text text} is bogger than the other cells, the content don't stay in the cell.

Can someone tell me how can i make the table align by the biggest cell of the row?

Thank you
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Help in table formatting

Post by localghost »

It couldn't be expressed better than php1ic did in his last sentence. Beside the Board Rules I want to add a specific thread [1]. It's in your own interest to follow the instructions unexceptionally.

[1] View topic: Avoidable mistakes


Best regards and welcome to the board
Thorsten
xana
Posts: 14
Joined: Mon May 31, 2010 5:31 am

Re: Help in table formatting

Post by xana »

Hello,

i'm sorry, but i'm a beginner in latex.

I try to do a table in latex with \multirow. The next examples shows what i want to do. The alignment of the cells should follow the longest cell (at the right).

-----------------------------------------------
| | | ABCABCABC |
| | B | ABCABCABC |
| ----------------- ABCABCABC |
| A | C | ABCABCABC |
| ----------------- ABCABCABC |
| | D | ABCABCABC |
| | | ABCABCABC |
-----------------------------------------------

My problem is that if i type:

\begin{tabular}{|c|c|c|}
\hline
A&B&C\\
\hline
1&2&\multirow{3}{*}{\parbox{6cm}{ABCABCABC ABCABCABC ABCABCABC ABCABCABC ABCABCABC ABCABCABC ABCABCABC ABCABCABC ABCABCABC ABCABCABC}}\\\cline{1-2}
3&4&\\\cline{1-2}
5&6&\\
\hline
\end{tabular}

The result is the following:

-----------------------------------------------
| | B | ABCABCABC |
| ----------------- ABCABCABC |
| A | C | ABCABCABC |
| ----------------- ABCABCABC |
| | D | ABCABCABC |
--------------------------------ABCABCABC------
ABCABCABC
ABCABCABC

Can somebodey please help me with this.

Thank you so much
xana
Posts: 14
Joined: Mon May 31, 2010 5:31 am

Re: Help in table formatting

Post by xana »

I'm sorry but the examples don't appear as i wished :roll:

My probelm is if the total content in columns B, C and D is smaller than the content in the other cells, that content continuous outside the cell.

I want that if the conten in the other cells is larger, the cell to stretch. But with that code that i posted before, the cells borders appear according to the content of columns B, C and D.

I'm sorry for the inconvenience :oops:
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Help in table formatting

Post by meho_r »

After reading all this, I have no idea what exactly do you wish to achieve. Please, can you draw "wrong" and "right" tables with a graphic tool like Inkscape, or even draw them on a piece of paper, then scan it, so that we get the right picture what do you wish to accomplish? Also, if you mark columns/rows with "A", "B", etc., don't use those letters to fill the content.
xana
Posts: 14
Joined: Mon May 31, 2010 5:31 am

Re: Help in table formatting

Post by xana »

This is an example of what i have now. The table cells don't align with the longest text and the text continuous beyond the cell. Hope this time i could express myself better.

Best regards
Attachments
example1.png
example1.png (29.11 KiB) Viewed 4936 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Help in table formatting

Post by localghost »

Since you are not providing a MWE I assume that you are not interested in a specific solution in form of code. So only some hints from my side.

It goes without saying that the content of a horizontal box can only occupy as much lines as given in the argument to the \multirow command. Every line that goes beyond this value will protrude the borders of the created cell.
xana
Posts: 14
Joined: Mon May 31, 2010 5:31 am

Help in table formatting

Post by xana »

Ok.
I'm sorry, the text in the column is in an other language :oops:
I'm also new at this forum, and i'm sorry if the previous posts are not complete.
The code for the previous table is posted bellow:

Code: Select all

\begin{center}
\footnotesize
\setlongtables
\renewcommand{\arraystretch}{1.5}
\renewcommand{\multirowsetup}{\centering}
\centering
\setlength{\tabcolsep}{2mm} 
\begin{table}{|>{\centering}m{2.6cm}|>{\centering}m{2.5cm}|>{\centering}m{2cm}|>{\centering}m{3cm}|>{\centering}m{3cm}|}
\caption{Vantagens e Desvantagens dos diversos m\'{e}todos de monitoriza\c{c}\~{a}o de glicose.}
 
                \hline
                \textbf{T\'{e}cnica de monitoriza\c{c}\~{a}o} & \textbf{M\'{e}todo} & \textbf{Interac\c{c}\~{a}o com o corpo humano} & \textbf{Vantagens} & \textbf{Desvantagens} \\
                \multirow{2}{2.6cm}{Espectroscopia de infravermelho próximo\linebreak (\emph{NIR - Near Infrared Spectroscopy})} &
                \multirow{2}{2.5cm}{Óptico\linebreak (Espectroscopia de absorção IR)} &
                Não-invasivo & \multirow{2}{3cm}{Rapidez da realização das medições;\linebreak Espectro não afectado por moléculas de água.} & \multirow{2}{3cm}{Dificuldade de distinção entre os sinais de glicose e os sinais interferentes (ruído);\linebreak Espectro tem maior probabilidade de ser dispersado do que absorvido.}  \\\cline{4-4}
                && Invasivo &&  \\\hline
                Espectroscopia de infravermelho médio\linebreak (MIR - Mid-Infrared Spectroscopy) & Óptico\linebreak (Espectroscopia de absorção IR) & Não-invasivo & Não requer a penetração da pele humana para realizar medições aos níveis glicêmicos. & Influências por parte de variações de temperatura;\linebreak Absorção das ondas Mid-IR pelas moléculas de água. \\\hline

\end{table}
\end{center}
Can you please tell me what is missing in my code?

Best regards
Post Reply