1

I have been trying to insert the table of dimensions of an antenna in a latex code. I used the code

\begin{table}[h]
\centering
\begin{tabular}{l | l | l | l | l}
Reference Number & BW (GhHz) & Antenna size (mm3) & Gain & Notched Bands (GHz) \\
\hline
[20] & 2.3-13.75  & 39*39*1 pt 6 & 1 pt 4-46 & 2 pt 25-3.75
5.08-5.9
7.06-7.95
 \\
[21] & 3.11-13.15 & 28*52*1.6 & 1.53-4.05 & 5.1-5.92 \\
[22] & 2.8-14 & 27*36*1.6 & N/A & 3.26-3.9
4.35-5.05
5.5-6.35
7.95-9.35
 \\
Current Work & 3.1 – 17 & 24*28*1.6 & 4.5-8 & 3.2-3.9
7.2-8.5

\end{tabular} \caption{Comparison of the suggested antenna to antennas in previous litrature} \end{table} \end{document}

but the error:

\begin{table}[h]
\centering
\begin{tabular}{l | l | l | l | l}
Reference Number & BW (GhHz) & Antenna size (mm3) & Gain & Notched Bands (GHz) \\
\hline
[20] & 2.3-13.75  & 39*39*1 pt 6 & 1 pt 4-46 & 2 pt 25-3.75
5.08-5.9
7.06-7.95
 \\
[21] & 3.11-13.15 & 28*52*1.6 & 1.53-4.05 & 5.1-5.92 \\
[22] & 2.8-14 & 27*36*1.6 & N/A & 3.26-3.9
4.35-5.05
5.5-6.35
7.95-9.35
 \\
Current Work & 3.1 – 17 & 24*28*1.6 & 4.5-8 & 3.2-3.9
7.2-8.5

\end{tabular} \caption{Comparison of the suggested antenna to antennas in previous litrature} \end{table} \end{document}

kept showing. How can I simply insert the dimension of an item in a table.

Roland
  • 6,655
  • 1
    Welcome to TeX.SE and Happy New Year! You need to enclose [20], [21] and [22] in curly braces : {[20]}, {[21]} and {[22]}. – Zarko Jan 01 '23 at 07:00
  • The point being that a number in square brackets immediately after \hline is picked up as an optional argument, which has to be a dimension. Using braces as suggested by @Zarko will prevent this. – Ian Thompson Jan 01 '23 at 07:58
  • There is also $\[...\]$ and $\leftbracket ... \rightbracket$. – John Kormylo Jan 01 '23 at 18:14

1 Answers1

0

See if the following MWE with your table is acceptable to you:

\documentclass{article}
\usepackage{makecell}
\setlength\extrarowheight{2pt}

\begin{document} \begin{table}[ht] \centering \begin{tabular}[t]{l | l | l | l | >{\raggedright\arraybackslash}p{9em}} \hline \makecell{Reference\ Number} & \makecell{BW\(GHz)} & \makecell{Antenna\ size (mm)} & \makecell{Gain\ (dB)} & \makecell{Notched\ Bands (GHz)} \ \hline {[20]} & 2.3-13.75 & 39391 & 4-46 & 25-3.75 5.08-5.9 7.06-7.95 \ {[21]} & 3.11-13.15 & 28521.6 & 1.53-4.05 & 5.1-5.92 \ {[22]} & 2.8-14 & 27361.6 & N/A & 3.26-3.9 4.35-5.05 5.5-6.35 7.95-9.35 \ Current Work & 3.1–17 & 24281.6 & 4.5-8 & 3.2-3.9 7.2-8.5 \ \hline \end{tabular} \caption{Comparison of the suggested antenna to antennas in previous literature} \end{table} \end{document}

enter image description here

(red lines indicate tex area borders)

Zarko
  • 296,517