如何消除錯誤的額外網格線?

如何消除錯誤的額外網格線?

下面的程式碼給我一個錯誤:

我該如何擺脫這些不好的額外線條?請參閱底部的圖片。

\begin{document}

\begin{table}

\begin{tabularx}{\linewidth}{|r|r|r|r|r|}

\hline

\multicolumn{1}{|>{\columncolor[gray]{.9}}c|}{$x$} &
\multicolumn{1}{ >{\columncolor[gray]{.9}}c|}{\textbf{Actual}} &
\multicolumn{1}{ >{\columncolor[gray]{.9}}c|}{\textbf{Approx.}} &
\multicolumn{1}{ >{\columncolor[gray]{.9}}c|}{\textbf{\% diff}} &
\multicolumn{1}{ >{\columncolor[gray]{.9}}c|}{\textbf{\% grow}} 

\\

\hline

2 & 1.0000 & 0.5576 & -44.2\% & 0.0\% \\ \hline
3 & 2.0000 & 1.4943 & -25.3\% & 168.0\% \\ \hline

\end{tabularx}

\end{table}

\end{document}

這是輸出: 在此輸入影像描述

另一個錯誤: 在此輸入影像描述

答案1

由於 tabularx 需要 X 類型列而導致的錯誤

將 tabularx 轉換為表格

刪除線寬指令

misscellaneous --使用行顏色而不是列顏色

相關內容