![Alinhamento vertical na tabela usando array não funciona](https://rvso.com/image/391709/Alinhamento%20vertical%20na%20tabela%20usando%20array%20n%C3%A3o%20funciona.png)
Veja abaixo meu código. Não mudei nada no código, apenas recompilei meu documento LaTeX e o alinhamento central vertical não está mais funcionando.
Como posso recuperar o alinhamento central vertical (como visto na captura de tela 'antes')?
Código:
\documentclass[10pt]{exam}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
\begin{table}
\centering
\begin{tabular}{| L{3cm} | L{8cm} | L{1.7cm} | L{1.7cm} |}
\hline
\textbf{Section} & \textbf{Description} & \textbf{Available Points} & \textbf{Earned Points}\\
\hline
\textbf{Cover Page} & Includes the title of the report, team name, and all of the team member names. & 1 & ~\\[1cm]
\hline
\textbf{Introduction} & Explains the project functionality and features. & 2 & ~\\[1cm]
\hline
\end{tabular}
\end{table}
\end{document}
Antes:
Depois:
Responder1
Também não funciona para mim. Proponho modificar a definição dos seus tipos de coluna para incorporar o S
pré-especificador (você pode usar outra letra se carregar siunitx
) do cellspace
. Isso garante nas colunas correspondentes um espaçamento vertical mínimo na parte superior e inferior das células:
\documentclass[10pt]{exam}
\usepackage{array, cellspace}
\setlength{\cellspacetoplimit}{2ex}
\setlength{\cellspacebottomlimit}{2ex}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}S{m{#1}}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}S{m{#1}}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}S{m{#1}}}
\begin{document}
\begin{table}
\centering
\begin{tabular}{| L{3cm} |L{8cm} | L{1.7cm} | L{1.7cm} |}
\hline
\textbf{Section} & \textbf{Description} & \textbf{Available Points} & \textbf{Earned Points}\\
\hline
\textbf{Cover Page} & Includes the title of the report, team name, and all of the team member names. & 1 & ~\\
\hline
\textbf{Introduction} & Explains the project functionality and features. & 2 & ~\\
\hline
\end{tabular}
\end{table}
\end{document}