我正在尝试使用 tabularx 创建一个简单的表格。我想将右侧单元格中的行分开。我编写了下面的代码,它似乎可以正常工作(从某种意义上说,我有预期的视觉效果),但我遇到了编译错误。
问题似乎出在命令上\addlinespace
。为了拉开线条,我也试过了\makecell[l]{content of the cell here}
,但似乎\seqsplit
命令有问题,不再起作用了。
我该如何修复我的代码或如何使用不同的命令获得相同的视觉效果?我正在使用 Overleaf。
\documentclass{article}
\usepackage{tabularx}
\usepackage{seqsplit}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\renewcommand\theadfont{\footnotesize\bfseries}%
\newcolumntype{K}{>{\footnotesize\raggedright\arraybackslash}X}
\begin{table}[ht]
\normalsize\rmfamily\caption{Field DKIM-Signature example}
\label{table:table-example-field-dkim-signature}
\centering
\begin{tabularx}{\textwidth}{>{\hsize=.5\hsize}K>{\hsize=1\hsize}K}
\toprule
\thead{Nome campo} & \thead{DKIM-Signature} \\
\toprule
20191002\_2\_rawplaintext.eml &
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014;
\addlinespace
\seqsplit{t=1570017017;bh=GuJwjTE60uCl6OYS9j/mGPgR3zd6tej8+oio/XCcU6U=;}
\addlinespace
h=Date:From:To:In-Reply-To:References:Subject;
\addlinespace
\seqsplit{b=Mqor4zXLPIhZkXMOnNd8lAX3PK+If8flI+mrYfDF39IskRv8Iuo2qfo2vSIeXKLOzlZLud18uhimRrEP 9OK5RVxpZtT51cekYjBCcKiGwn2dnAPnKdkGTYvVeCaVfurF/qOM08wEdhL6iZ/8ytpqS3M2AG8ZRRZYhSdLKUu8a1/D69dWV9JLKyRlLmb/BxNQDKRwaVTp4IzUcDsEc627yy2l8i5o4iDmLQpjsxX42EJzRRPOoq9W60mekOMjZgLlhmcnMGvqUDwR/hbBunIFWqZkDONAJi9idfJ4nLwYsh2mmUZq7a5d505BfhNRpo7+Zbq1m2cLQjoxE7A39FpB4w==} \\
\midrule
\end{tabularx}
\end{table}
\end{document}
答案1
这是你想要的吗?一个空白行就可以完成这个工作,你可以在其中添加一些\vskip
。注意我必须更改表格序言中的系数(\hsize= k\hsize
):系数的总和必须等于列数X
。
\documentclass{article}
\usepackage{tabularx}
\usepackage{seqsplit}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\renewcommand\theadfont{\footnotesize\bfseries}%
\newcolumntype{K}{>{\footnotesize\raggedright\arraybackslash}X}
\begin{table}[ht]
\normalsize\rmfamily\caption{Field DKIM-Signature example}
\label{table:table-example-field-dkim-signature}
\centering
\begin{tabularx}{\textwidth}{>{\hsize=0.67\hsize}K>{\hsize=1.33\hsize}K}
\toprule
\thead{Nome campo} & \thead{DKIM-Signature} \\
\toprule
20191002\_2\_rawplaintext.eml &
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014;\bigskip
\seqsplit{t=1570017017;bh=GuJwjTE60uCl6OYS9j/mGPgR3zd6tej8+oio/XCcU6U=;}\bigskip
h=Date:From:To:In-Reply-To:References:Subject;\bigskip
%\addlinespace
\seqsplit{b=Mqor4zXLPIhZkXMOnNd8lAX3PK+If8flI+mrYfDF39IskRv8Iuo2qfo2vSIeXKLOzlZLud18uhimRrEP 9OK5RVxpZtT51cekYjBCcKiGwn2dnAPnKdkGTYvVeCaVfurF/qOM08wEdhL6iZ/8ytpqS3M2AG8ZRRZYhSdLKUu8a1/D69dWV9JLKyRlLmb/BxNQDKRwaVTp4IzUcDsEc627yy2l8i5o4iDmLQpjsxX42EJzRRPOoq9W60mekOMjZgLlhmcnMGvqUDwR/hbBunIFWqZkDONAJi9idfJ4nLwYsh2mmUZq7a5d505BfhNRpo7+Zbq1m2cLQjoxE7A39FpB4w==} \\
\midrule
\end{tabularx}
\end{table}
\end{document}