
Quando eu tenho umquebra de linha manualem uma célula de uma tabularx
tabela, a linha vertical desaparece.
\documentclass{article}
\usepackage{tabularx}
\usepackage[sfdefault]{cabin}
% https://tex.stackexchange.com/questions/89166
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{document}
\begin{tabularx}{\textwidth}{lc|l|Y|Y|Y|Y}
\hline
% Row
Text & & & & & & \\ \hline
% Row
Text\\ Text & & & & & & \\ \hline
\end{tabularx}
\end{document}
Relacionado
Responder1
Se você quiser quebras de linha em um dos l, c, r
tipos de coluna, será necessário carregar makecell
o pacote e usar seu comando de mesmo nome. Caso contrário, \\
é considerado uma alteração de linha. Com este código, está tudo bem:
\documentclass{article}
\usepackage{tabularx, makecell}
\usepackage{fontawesome}
\usepackage[sfdefault]{cabin}
% https://tex.stackexchange.com/questions/89166
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{document}
\begin{tabularx}{\textwidth}{lc|l|Y|Y|Y|Y}
\hline
% Row
Text & & & & & & \\ \hline
% Row
\makecell[l]{Text\\ Text} & & & & & & \\ \hline
\end{tabularx}
\end{document}
Responder2
Você sempre pode colocar caixas em tabelas nas quais \\
não termine a linha da tabela. Um comando útil é \pbox
que ele não usa mais espaço do que o necessário, mas tem largura máxima. Infelizmente, o espaçamento vertical não cabe apenas em \pbox
. Aqui está um exemplo:
\documentclass{article}
\usepackage{tabularx}
\usepackage{pbox}
% https://tex.stackexchange.com/questions/89166
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{document}
\begin{tabularx}{\textwidth}{lc|l|Y|Y|Y|Y}
\hline
% Row
Text & & & & & & \\ \hline
% Row
\pbox{\textwidth}{Text\\ Text} & & & & & & \\ \hline
\end{tabularx}
\end{document}
Pode-se ver claramente que o espaçamento vertical não está correto na imagem acima.