Cómo evitar que la altura extra afecte a la primera fila

Cómo evitar que la altura extra afecte a la primera fila

Solía extrarowheight​​​​agregar algo de espacio adicional entre filas en una tabla que contiene solo texto. Si bien esto funciona bien, también afecta a la primera fila. ¿Hay alguna manera de detener esto o tal vez eliminar el espacio adicional solo en la primera fila? Me doy cuenta de que podría lograr el espacio entre las filas de manera diferente, pero quiero evitarlo si es posible. La flecha azul indica el espacio que me gustaría reducir.

Aquí una captura de pantalla y MWE.

Tabla de ejemplo

\documentclass[12pt, a4paper]{memoir}
\usepackage[utf8]{inputenc}

\settypeblocksize{237mm}{150mm}{*} % size of text block on page

\begin{document}

\begin{table}[!htb]
\caption{Severity of identified problems and proposed changes}
\label{some_changes}
\setlength{\extrarowheight}{5mm} %add row padding
\begin{tabular}{>{\raggedright}p{3.5cm} >{\raggedright}p{8.5cm} p{1.5cm}}
\toprule
Change & Justification & Severity\\
\midrule
1. \parbox[t]{3cm}{\raggedright A few meaningful definitions} &
Just some sample text that is longer than a couple of lines. This text has 
no meaning, it's just a sample text and does not do anything but fill some 
space here. & 
High\\
2. \parbox[t]{3cm}{\raggedright Some other thing that needs a change} &
Just some sample text that is longer than a couple of lines. This text has 
no meaning, it's just a sample text and does not do anything but fill some 
space here. & 
Medium\\
3. \parbox[t]{3cm}{\raggedright Some other thing that needs a change} &
Just some sample text that is longer than a couple of lines. This text has 
no meaning, it's just a sample text and does not do anything but fill some 
space here. &  
Low\\
\bottomrule
\end{tabular}
\end{table}

\end{document}

Respuesta1

Una solución alternativa:

\documentclass[12pt, a4paper]{memoir}
\usepackage[utf8]{inputenc}

\settypeblocksize{237mm}{150mm}{*} % size of text block on page

\begin{document}
\begin{table}[!htb]
\caption{Severity of identified problems and proposed changes}
\label{some_changes}
\setlength{\extrarowheight}{5mm} %add row padding
\begin{tabular}{>{\raggedright}p{3.5cm} >{\raggedright}p{8.5cm} p{1.5cm}}
\toprule
\\[-3\normalbaselineskip] % <------------- Add this
Change & Justification & Severity\\
\midrule
1. \parbox[t]{3cm}{\raggedright A few meaningful definitions} &
Just some sample text that is longer than a couple of lines. This text has 
no meaning, it's just a sample text and does not do anything but fill some 
space here. & 
High\\
2. \parbox[t]{3cm}{\raggedright Some other thing that needs a change} &
Just some sample text that is longer than a couple of lines. This text has 
no meaning, it's just a sample text and does not do anything but fill some 
space here. & 
Medium\\
3. \parbox[t]{3cm}{\raggedright Some other thing that needs a change} &
Just some sample text that is longer than a couple of lines. This text has 
no meaning, it's just a sample text and does not do anything but fill some 
space here. &  
Low\\
\bottomrule
\end{tabular}
\end{table}
\end{document}

La idea principal es agregar un espacio negativo después de \toprulepara negar el relleno agregado desde el archivo \extrarowheight. Añadiendo

\\[-3\normalbaselineskip]

parece restaurar la primera fila a su altura original (sin relleno). Pero, por supuesto, siempre puedes cambiar el valor entre corchetes por el que quieras.

ingrese la descripción de la imagen aquí

Respuesta2

\addlinespace[5mm]¿El uso del paquete es booktabsuna opción aceptable para usted?

\documentclass[12pt, a4paper]{memoir}
\usepackage[utf8]{inputenc}

\settypeblocksize{237mm}{150mm}{*} % size of text block on page

\usepackage{lipsum}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}

\begin{document}
    \begin{table}[htb]
\caption{Severity of identified problems and proposed changes}
\label{some_changes}
\begin{tabular}{>{\raggedright}p{0.6cm}@{\ }>{\raggedright}p{3cm} >{\raggedright}p{8.5cm} p{1.5cm}}
\toprule
\multicolumn{2}{l}{Change} & Justification & Severity\\
\midrule\addlinespace[5mm]
1. & A few meaningful definitions &
\lipsum*[11] &
High\\  \addlinespace[5mm]
2. & \raggedright Some other thing that needs a change &
\lipsum*[11] &
Medium\\ \addlinespace[5mm]
3. &  Some other thing that needs a change &
\lipsum*[11] &
Low\\
\bottomrule
\end{tabular}
    \end{table}
\end{document}

ingrese la descripción de la imagen aquí

información relacionada