\begin{longtable}{|lllllllll|}
% [ht]
\caption{Create } \\
%\label{step 3}
\hline
\multicolumn{3}{|l|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}}\\
\hline
\endfirsthead
\multicolumn{6}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\multicolumn{3}{|l|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}}\\
\hline
\endhead
\hline \multicolumn{6}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
% \begin{tabular} {lllllll}[ht]\\
% \hline \multicolumn{3}{|l|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}} \\ \hline
\multicolumn{7}{|l|}{\textbf{Begin}}\\ \hline
\multicolumn{7}{|l|}{\textbf{Initial}}\\ \hline
\parbox[|c|]{2cm}{
\includegraphics[scale=0.40,height=8 cm,width=10 cm]{initialfgist.jpg}} \\ \hline
\end{longtable}
圖片的右側和上邊框沒來。請告訴我我做錯了什麼?
答案1
\parbox[|c|]{2cm}{
\includegraphics[scale=0.40,height=8 cm,width=10 cm]
這指定了 2 厘米寬的盒子中的 10 厘米寬的圖像,因此預計會出現疊印。至少它會指定如果它是\parbox{2cm}
但是 \parbox[|c|]
語法錯誤(儘管 Latex 不會這樣報告),則可選參數只能是c
,t
或b
。
您只想指定一的scale
,width
並且您根本height
不想要。\parbox
答案2
該cellspace
套件是為此而設計的:它在列中定義了單元格頂部和底部的最小垂直間距,並帶有以字母為前綴的說明符S
(或C
如果您使用siunitx
)。我還簡化了您的程式碼並糾正了錯誤的地方:
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{graphicx}
\usepackage{array, longtable}
\usepackage{cellspace}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}
\begin{document}
\begin{longtable}{|*{7}{Sl}|}
\caption{Create } \\
%\label{step 3}
\hline
\multicolumn{3}{|Sl|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}}\\
\hline
\endfirsthead
\multicolumn{6}{Sc}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\multicolumn{3}{|Sl|}{\textbf{Prefix}} & \multicolumn{2}{l|}{\textbf{Class label}} & \multicolumn{2}{l|}{\textbf{Intersection}}\\
\hline
\endhead
\hline \multicolumn{7}{Sr}{\textit{Continued on next page}} \\
\endfoot
\hline
\multicolumn{7}{|Sl|}{\textbf{Begin}}\\
\hline
\multicolumn{7}{|Sl|}{\textbf{Initial}}\\
\hline
\includegraphics[scale=0.40]{initialfgist.jpg} & & & & & & \\
\hline
\end{longtable}
\end{document}