表の前に余分な行

表の前に余分な行
\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}

表2

を除去すると@{\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}

表3

答え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}

関連情報