当我编译我的 LaTeX 文件时,表格的左行丢失了。这个问题的正确解决方案是什么?请有人指导我。图片如下图所示。
我的命令
\begin{table}[h]
\centering
\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{c|}{\textbf{Tm:YLF crystal}} \\ \hline
Crystal phase & Tetragonal \\ \hline
Chemical formula & $Tm:YLiF_{4}$ \\ \hline
Melting point & $1075^{\hspace{0.03in}\circ}$C \\ \hline
Density & $7.27 g/cm^{3}$ \\ \hline
Site Symmetry of $Y^{3+}$ & S4 \\ \hline
Thermal conductivity & 0.6 W/cm. K \\ \hline
\end{tabular}
\caption{Tm:YLF crystal properties}
\label{tab:msg1}
\end{table}
答案1
|
您的标题中似乎缺少: \multicolumn{2}{c|}{\textbf{Tm:YLF crystal}}
。
我在下面的代码中修复了这个问题,还添加了表格的副本,其中包含一些可能对你的读者和你本人进行改进的建议。
输出
代码
\documentclass[11pt]{article}
\usepackage{booktabs}% More proffesional look of tables.
\usepackage{siunitx}% An awesome package for typesetting and manipulation numbers and units.
\usepackage{caption}% Better control over caption
\usepackage{lipsum}% Example text
\newcommand{\tableHeader}[1]{\textbf{#1}}
\sisetup{per-mode=symbol}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{|c|}{\textbf{Tm:YLF crystal}} \\ \hline
Crystal phase & Tetragonal \\ \hline
Chemical formula & $Tm:YLiF_{4}$ \\ \hline
Melting point & $1075^{\hspace{0.03in}\circ}$C \\ \hline
Density & $7.27 g/cm^{3}$ \\ \hline
Site Symmetry of $Y^{3+}$ & S4 \\ \hline
Thermal conductivity & 0.6 W/cm. K \\ \hline
\end{tabular}
\caption{Tm:YLF crystal properties}
\label{tab:msg1}
\end{table}
\lipsum[2]
\begin{table}[h]
\centering
\caption{Tm:YLF crystal properties}
\begin{tabular}{cc}
\toprule
\multicolumn{2}{c}{\tableHeader{Tm:YLF crystal}} \\
\midrule
Crystal phase & Tetragonal \\
Chemical formula & \(\mathrm{Tm:YLiF_{4}}\) \\
Melting point & \SI{1075}{\celsius} \\
Density & \SI{7,27}{\gram\per\cubic\centi\metre} \\
Site Symmetry of \(Y^{3+}\) & S4 \\
Thermal conductivity & \SI{0,6}{\watt\per\centi\metre\per\kelvin} \\
\bottomrule
\end{tabular}
\label{tab:msg1}
\end{table}
\lipsum[3]
\end{document}