![為什麼我的表無法編譯?](https://rvso.com/image/370706/%E7%82%BA%E4%BB%80%E9%BA%BC%E6%88%91%E7%9A%84%E8%A1%A8%E7%84%A1%E6%B3%95%E7%B7%A8%E8%AD%AF%EF%BC%9F.png)
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{|c|c|c|}
\hline
I (mA) & V (V) \pm 0.0001 & L12 (H) \bigstrut\\
\hline
1 & 0.3 & 1.5 \bigstrut\\
\hline
2 & 0.20 & 1.30 \bigstrut\\
\hline
3 & 1.29 & 1.5 \bigstrut\\
\hline
4 & 1.9 & 1.62 \bigstrut\\
\hline
5 & 2.51 & 1.68 \bigstrut\\
\hline
6 & 3.11 & 1.2 \bigstrut\\
\hline
7 & 3.6 & 1.4 \bigstrut\\
\hline
8 & 4.5 & 1.19 \bigstrut\\
\hline
9 & 5.0 & 1.1 \bigstrut\\
\hline
10 & 6.07 & 1.8 \bigstrut\\
\hline
\end{tabular}
\label{tab:addlabel}
\end{table}
答案1
包括bigstrut
打包並更改pm
為$\pm$
\documentclass[]{article}
\usepackage{bigstrut}
\begin{document}
\begin{table}[htbp]
\centering
\caption{Add caption}
\begin{tabular}{|c|c|c|}
\hline
I (mA) & V (V) $\pm$ 0.0001 & L12 (H) \bigstrut\\
\hline
1 & 0.3 & 1.5 \bigstrut\\
\hline
2 & 0.20 & 1.30 \bigstrut\\
\hline
3 & 1.29 & 1.5 \bigstrut\\
\hline
4 & 1.9 & 1.62 \bigstrut\\
\hline
5 & 2.51 & 1.68 \bigstrut\\
\hline
6 & 3.11 & 1.2 \bigstrut\\
\hline
7 & 3.6 & 1.4 \bigstrut\\
\hline
8 & 4.5 & 1.19 \bigstrut\\
\hline
9 & 5.0 & 1.1 \bigstrut\\
\hline
10 & 6.07 & 1.8 \bigstrut\\
\hline
\end{tabular}
\label{tab:addlabel}
\end{table}
\end{document}
答案2
我將按以下方式重新設計您的桌子:
\documentclass{article}
\usepackage{booktabs} % added
\usepackage{siunitx} % added
\begin{document}
\begin{table}[htbp]
\centering
\caption{Add caption}
\label{tab:addlabel}
\renewcommand\arraystretch{1.1}% added
\begin{tabular}{ S[table-format=2.0]% changed to use S column type from siunitx
*{2}{S[table-format=1.2]}
}
\toprule % rules from booktabs
{I (mA)} & {V (V) $\pm$ 0.0001}
& {L12 (H)} \\
\midrule
1 & 0.3 & 1.5 \\
2 & 0.20 & 1.30 \\
3 & 1.29 & 1.5 \\
4 & 1.9 & 1.62 \\
5 & 2.51 & 1.68 \\
6 & 3.11 & 1.2 \\
7 & 3.6 & 1.4 \\
8 & 4.5 & 1.19 \\
9 & 5.0 & 1.1 \\
10 & 6.07 & 1.8 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}