2

How do I to space these two cells on this way?

enter image description here

And not on this way:

enter image description here

Code:

\begingroup
\setlength{\LTleft}{-20cm plus -1fill}
\setlength{\LTright}{\LTleft}
\begin{longtable}{|>{\centering\arraybackslash}p{5cm}|>{\centering\arraybackslash}p{3cm}|p{8cm}|}
\hline
\textbf{Classe} & \textbf{Stéréotype} & \multicolumn{1}{|c|}{\textbf{R\^ole}} \tabularnewline
\hline
\raisebox{-0.35cm}{Les classes de dialogues} \og Boundary \fg & \raisebox{-0.95cm}{\includegraphics[scale=0.7]{images/st_boundary}} & Elles permettent l'interaction entre l'IHM et les utilisateurs. Ces classes sont directement issues de l'analyse de maquette. \tabularnewline
\hline
\raisebox{-0.95cm}{Les classes de contr\^oles} \og Control \fg & \raisebox{-1.72cm}{\includegraphics[scale=0.7]{images/st_control}} & Ces classes modélisent la cinématique de l'application. Elles font la jonction entre les dilogues et les classes métiers en permettant aux différentes  vues de l'application de manipuler les informations détenues par un ou plusieurs objets métiers.\tabularnewline
\hline
\raisebox{-0.7cm}{Les classes entités} \og Entity \fg & \raisebox{-1.2cm}{\includegraphics[scale=0.7]{images/st_entity}} & Ces classes sont fénéralement persistantes, elles proviennent directement du mod\`ele du domaine et permettent \`a des données et des relations d'\^etre stockées dans des fichiers ou des bases de données. \tabularnewline
\hline
\multicolumn{3}{l}{} \\[-7pt] 
\caption[]{Description des classes d'analyse.}
\end{longtable}
\endgroup

This is what I'm trying to make at final:

enter image description here

Thanks a lot !!

4

Please, next time, post a compilable example...

You shouldn't use those \raiseboxes to place material in your table.

Try using the m column specifier instead of p and add the valign=C option in the \includegraphics (requires the adjustbox package with option export).

Also, you can issue a \par if you want to put some text below some other.

Finally, to add some spacing between the table and its caption, load the caption package and issue the command

\captionsetup[longtable]{skip=1em}

instead of inserting the line

\multicolumn{3}{l}{} \\[-7pt] 

in your table.

MWE:

\documentclass{article}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[demo]{graphicx}
\usepackage{longtable,array}
\usepackage[export]{adjustbox}
\usepackage{caption}
\captionsetup[longtable]{skip=1em}

\begin{document}

\begingroup
\setlength{\LTleft}{-20cm plus -1fill}
\setlength{\LTright}{\LTleft}
\begin{longtable}{|>{\centering\arraybackslash}m{5cm}|>{\centering\arraybackslash}m{3cm}|m{8cm}|}
\hline
\textbf{Classe} & \textbf{Stéréotype} & \multicolumn{1}{|c|}{\textbf{R\^ole}} \tabularnewline
\hline
Les classes de dialogues\par \og Boundary \fg &
\includegraphics[width=1cm,height=1cm,valign=C]{images/st_boundary} &
Elles permettent l'interaction entre l'IHM et les utilisateurs. Ces classes sont directement issues de l'analyse de maquette. \tabularnewline
\hline
Les classes de contr\^oles\par \og Control \fg &
\includegraphics[width=1cm,height=1cm,valign=C]{images/st_control} &
Ces classes modélisent la cinématique de l'application. Elles font la jonction entre les dilogues et les classes métiers en permettant aux différentes  vues de l'application de manipuler les informations détenues par un ou plusieurs objets métiers.\tabularnewline
\hline
Les classes entités\par \og Entity \fg &
\includegraphics[width=1cm,height=1cm,valign=C]{images/st_entity} &
Ces classes sont fénéralement persistantes, elles proviennent directement du mod\`ele du domaine et permettent \`a des données et des relations d'\^etre stockées dans des fichiers ou des bases de données. \tabularnewline
\hline
\caption[]{Description des classes d'analyse.}
\end{longtable}
\endgroup

\end{document} 

Output:

enter image description here

P.S. In the \includegraphics I've changed scale=0.7 to width=1cm,height=1cm for displaying purposes since I do not have your images. Turn them back in your document.

|improve this answer|||||
  • Thanks for your response, but, what I'm trying to do, is just to center vertically and horizontally the content of the two cells of Control & Entity. No need to change the design of other cells unless the code is misused. – dgs Feb 19 '14 at 8:40
  • @user3289501 So you want all cells to be top aligned, except the one with Control & Entity? – karlkoeller Feb 19 '14 at 8:42
  • I've updated my post. – dgs Feb 19 '14 at 8:45
  • @user3289501 I've updated the answer. See if it helps with your real images. – karlkoeller Feb 19 '14 at 9:28
  • Perfect ! Thank you very much !! +1 – dgs Feb 19 '14 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.