
\documentclass[12pt]{article}
\usepackage{tabularx}
\begin{document}
\section{section 1}
\begin{tabular*}{0.75\textwidth}{@{\extracolsep{\fill} } | c | c | c | r | }
\hline
label 1 & label 2 & label 3 & label 4 \\
\hline
item 1 & item 2 & item 3 & item 4 \\
\hline
\end{tabular*}
\end{document}
生成された結果には、余分な線がいくつかあります。なぜこのような余分な境界線が表示されるのでしょうか。また、これらを削除するにはどうすればよいでしょうか。
アップデート:
最初のパイプラインを削除しても|
効果はありません。
\documentclass[12pt]{article}
\usepackage{tabularx}
\begin{document}
\section{section 1}
\begin{tabular*}{0.75\textwidth}{@{\extracolsep{\fill} } c | c | c | r | }
\hline
label 1 & label 2 & label 3 & label 4 \\
\hline
item 1 & item 2 & item 3 & item 4 \\
\hline
\end{tabular*}
\end{document}
を除去すると@{\extracolsep{\fill} }
次のようになります。
\documentclass[12pt]{article}
\usepackage{tabularx}
\begin{document}
\section{section 1}
\begin{tabular*}{0.75\textwidth}{ | c | c | c | r | }
\hline
label 1 & label 2 & label 3 & label 4 \\
\hline
item 1 & item 2 & item 3 & item 4 \\
\hline
\end{tabular*}
\end{document}
答え1
AboAmmar のおかげで、問題は解決しました:
\documentclass[12pt]{article}
\usepackage{tabularx}
\begin{document}
\section{section 1}
\begin{tabular*}{0.75\textwidth}{ | c @{\extracolsep{\fill} } | c | c | r | }
\hline
label 1 & label 2 & label 3 & label 4 \\
\hline
item 1 & item 2 & item 3 & item 4 \\
\hline
\end{tabular*}
\end{document}
彼のもう一つの提案:
表の内容よりも広い幅 (.75\textwidth) を指定しました。通常の表形式を使用し、.75\textwidth を削除してください。
答え2
この MWE では 2 つの方法が可能です。1 つ目は自然な方法でボックスにフィットさせ、2 つ目はボックスを標準サイズより 50% 大きく拡大します。
\documentclass[12pt]{article}
\usepackage{tabularx}
\begin{document}
\section{section 1}
\begin{tabular}{|c|c|c|r|}
\hline
label 1 & label 2 & label 3 & label 4 \\
\hline
item 1 & item 2 & item 3 & item 4 \\
\hline
\end{tabular}
\vspace{5mm}
\scalebox{1.50}{ %scales the box 1.5 times the normal size
\begin{tabular}{|c|c|c|r|}
\hline
label 1 & label 2 & label 3 & label 4 \\
\hline
item 1 & item 2 & item 3 & item 4 \\
\hline
\end{tabular}
}
\end{document}