我想创造下表标题。为此,我有类似的东西,但它并不完全相同:
\documentclass{article}
\begin{document}
\begin{table}[h]
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
Work & Prime (bits) & \# FFs & \# LUTs & \# Slices & \# DSPs & \# BRAMs & Freq. (MHz) & Latency (cc $\times 10^6$) & Total time (ms) \\
\hline \hline
\end{tabular}
\end{center}
\end{table}
\end{document}
首先,正如我链接的图片所示,有两个列单元格被分成两个部分,我该如何实现呢?此外,您可以看到,在包含的列中#
,标签符号写在上面,文本写在下面,我该如何实现呢?
答案1
该makecell
包允许在标准单元格中换行。无关:不要使用center
内的环境table
:它添加了一个补充的、不需要的垂直空间。请\centering
改为添加。
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{multirow, makecell}
\begin{document}
\begin{table}[h]
\centering\setlength{\extrarowheight}{2pt}
\centering
\begin{tabular}{|*{10}{c|}}
\hline
\multirowcell{3}{Work} & \multirowcell{3}{Prime\\[1ex] (bits)} & \multicolumn{5}{c|}{Area} & \multicolumn{3}{c|}{Time} \\
\cline{3-10}
& & \makecell{\# \\FFs} & \makecell{\#\\ LUTs} & \makecell{\#\\ Slices} & \makecell{\# \\ DSPs} & \makecell{\# \\ BRAMs} & \makecell{Freq.\\ (MHz)} & \makecell{Latency \\ (cc${}\times 10^6$)} & \makecell{Total time\\ (ms)} \\
\hline \hline
\end{tabular}
\end{table}
\end{document}