![表格未定位在程式碼指示的文字點上](https://rvso.com/image/328819/%E8%A1%A8%E6%A0%BC%E6%9C%AA%E5%AE%9A%E4%BD%8D%E5%9C%A8%E7%A8%8B%E5%BC%8F%E7%A2%BC%E6%8C%87%E7%A4%BA%E7%9A%84%E6%96%87%E5%AD%97%E9%BB%9E%E4%B8%8A.png)
我是乳膠新手。我正在寫論文,遇到這樣的情況:
texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext**:**
\begin{table}[h]
\begin{center}
\noindent\begin{tabular}{|c|c|c|}
\hline
\rowcolor{gray!50}
\bfseries Specifiche Tecniche & \bfseries Bluetooth BR & \bfseries Bletooth Low Energy \\
\hline
Frequenza & Tra $2400$ e $2483.5$ MHz & Tra $2400$ e $2483.5$ MHz \\
\hline
Data Channel & $79$ & $37$ \\
\hline
Advertising Channel & $32$ & $3$ \\
\hline
Criptaggio & $64/128 bit$ & AES $128$ bit \\
\hline
Range & $100$ m & $> 100$m \\
\hline
Throughput & $0.7-2.1$ Mbit/s & $< 0.3$ Mbit/s \\
\hline
Latenza di Connessione & $ \approx 100$ ms & $6$ ms \\
\hline
Tempo minimo di invio dati & $100$ ms & $3$ ms \\
\hline
Potenza di consumo & $1$ W & Tra $0.01$ a $0.5$ W \\
\hline
Picco di corrente & $22-40$ mA & $10-30$ mA \\
\hline
\end{tabular}
\caption[Differenze tra Bluetooth BR \& Bluetooth 4.0]{Differenze tra Bluetooth BR \& Bluetooth 4.0}
\label{tab:my_label}
\end{center}
\end{table} \\
othertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertextothertext.
問題是,我將在這一點上的表,由編譯器將其放置在下一頁的開頭。
(PS:抱歉我的英文不好)
答案1
如果您不希望表格資料「浮動」(在 LaTeX 意義上),請不要將其包含在浮動環境中,例如table
.一定要學會使用 LaTeX 的浮動放置演算法——通常情況下,它是非常好的。如果必須,請提供[h!]
定位說明符。如果頁面仍然無法容納表格,則該頁面上可能沒有足夠的空間來容納表格。
我還有兩個額外的建議:
省略表格材料中的所有垂直線和大多數水平線,並使用包裝的畫線宏
booktabs
來繪製剩餘的水平線。使用套件中的
\num
和\SI
宏siunitx
分別表示標量和帶單位的數字。
進行這些調整的結果如以下螢幕截圖所示。
\documentclass{article}
\usepackage{booktabs}
\usepackage[table]{xcolor}
\usepackage[binary-units,per-mode=symbol]{siunitx}
\usepackage[italian]{babel}
\begin{document}
\begin{table}[h!]
\renewcommand\arraystretch{1.1}
\setlength\tabcolsep{5pt} % default: 6pt
\centering % not '\begin{center}...\end{center}'
\begin{tabular}{lcc}
\rowcolor{gray!30}
\bfseries Specifiche Tecniche & \bfseries Bluetooth BR & \bfseries Bluetooth Low Energy \\
\addlinespace
Frequenza & \num{2400}--\SI{2483.5}{\mega\hertz} & \num{2400}--\SI{2483.5}{\mega\hertz} \\
Data Channel & 79 & 37 \\
Advertising Channel & 32 & 3 \\
Criptaggio & \SI{64/128}{\bit} & AES \SI{128}{\bit} \\
Range & \SI{100}{\meter} & ${}>\SI{100}{\meter}$ \\
Throughput & \num{0.7}--\SI{2.1}{\mega\bit\per\second} & ${}< 0.3$ Mbit/s \\
Latenza di Connessione & ${}\approx \SI{100}{\milli\second}$ & \SI{6}{\milli\second} \\
Tempo minimo di invio dati & \SI{100}{\milli\second} & \SI{3}{\milli\second} \\
Potenza di consumo & \SI{1}{\watt} & \num{0.01}--\SI{0.5}{\watt} \\
Picco di corrente & \num{22}--\SI{40}{\milli\ampere} & \num{10}--\SI{30}{\milli\ampere} \\
\bottomrule
\end{tabular}
\caption[Differenze tra Bluetooth BR e Bluetooth 4.0]{Differenze tra Bluetooth BR e Bluetooth 4.0}
\label{tab:my_label}
\end{table}
\end{document}
答案2
[解決]感謝指導sharelatexhttps://it.sharelatex.com/learn/Positioning_images_and_tables- 定位表部分我使用了參數 H 而不是 h!米科建議的。為此,我的新程式碼是:
\begin{table}[H]
\centering
\begin{tabular}{|c|c|c|}
\hline
\rowcolor{gray!50}
\bfseries Specifiche Tecniche & \bfseries Bluetooth BR & \bfseries Bletooth Low Energy \\
\hline
Frequenza & Tra $2400$ e $2483.5$ MHz & Tra $2400$ e $2483.5$ MHz \\
\hline
Data Channel & $79$ & $37$ \\
\hline
Advertising Channel & $32$ & $3$ \\
\hline
Criptaggio & $64/128 bit$ & AES $128$ bit \\
\hline
Range & $100$ m & $> 100$m \\
\hline
Throughput & $0.7-2.1$ Mbit/s & $< 0.3$ Mbit/s \\
\hline
Latenza di Connessione & $ \approx 100$ ms & $6$ ms \\
\hline
Tempo minimo di invio dati & $100$ ms & $3$ ms \\
\hline
Potenza di consumo & $1$ W & Tra $0.01$ a $0.5$ W \\
\hline
Picco di corrente & $22-40$ mA & $10-30$ mA \\
\hline
\end{tabular}
\caption[Differenze tra Bluetooth BR \& Bluetooth 4.0]{Differenze tra Bluetooth BR \& Bluetooth 4.0}
\label{tab:my_label}
\end{table}
致上最誠摯的問候,謝謝大家