1

Can you please suggest me better way to format these tables or to find the error in the following code.How to align both the tables side by side in one page

\section{Tabulation}
\subsection{2nd Order Low pass Filter}
\resizebox{\textwidth}{!}{\begin{tabular}{|c|c|}
\hline
 Frequency(f, in Hz)& V_{0}(in Volts)  \\ \hline
 100& 1.575   \\ \hline
 300& 1.58\\ \hline
 500& 1.59  \\ \hline
  700& 1.534 \\ \hline
 900& 1.39 \\ \hline
 1000& 1.32  \\ \hline
  1.1K & 1.26  \\ \hline
   1.2K& 1.06 \\ \hline
   1.5K& 865.037mV  \\ \hline
 2K & 509.503mV \\ \hline\\
 4K & 141.045mV   \\ \hline
  6K & 62.824mV  \\ \hline\\

 \end{tabular}}

\resizebox{\textwidth}{!}{\begin{tabular}{|c|c|}
\hline
 Frequency(f, in Hz)& V_{0}(in Volts)  \\ \hline
 100& 1.575   \\ \hline
 300& 1.58\\ \hline
 500& 1.59  \\ \hline
  700& 1.534 \\ \hline
 900& 1.39 \\ \hline
 1000& 1.32  \\ \hline
  1.1K & 1.26  \\ \hline
   1.2K& 1.06 \\ \hline
   1.5K& 865.037mV  \\ \hline
 2K & 509.503mV \\ \hline\\
 4K & 141.045mV   \\ \hline
  6K & 62.824mV  \\ \hline\\

 \end{tabular}}
0

2 Answers 2

2

Some observations and comments.

  • The most serious issue is that you haven't encased V_{0} in $ symbols to initiate and terminate inline math mode. Once you place V_{0} in math mode, the code becomes compilable (but the table still has a few issues).

  • You also have superfluous extra line-break directives.

  • In terms of aesthetics, the result of \resizebox is utterly devastating. Why are you using this directive?

  • Still on the subject of aesthetics, get rid of all vertical lines and most horizontals lines, and use the line-drawing macros of the booktabs package instead of \hline for the three remaining horizontal lines.

  • Do also give some thought to organizing the header material more clearly

  • It may also be a good idea to align the numerical data in both columns on their respective (implied or explicit) decimal markers. This may be achieved by loading the siunitx package and using the S column type provided by that package.

enter image description here

\documentclass{article}
\usepackage{siunitx,booktabs}
\begin{document}

\noindent
\begin{tabular}{S[table-format=4.0] S[table-format=1.6]}
\toprule
 {Frequency $f$ }   & {$V_{0}$}  \\ 
 {(in \si{\hertz})} & { (in \si{\volt})} \\
\midrule
  100 & 1.575 \\ 
  300 & 1.58  \\ 
  500 & 1.59  \\ 
  700 & 1.534 \\ 
  900 & 1.39  \\ 
 1000 & 1.32  \\ 
 1100 & 1.26  \\ 
 1200 & 1.06  \\ 
 1500 & 0.865037 \\ 
 2000 & 0.509503 \\ 
 4000 & 0.141045 \\ 
 6000 & 0.062824 \\ 
\bottomrule
\end{tabular}
\end{document}
1

You should take a closer look at your error-messages. It says:

-> ! Missing $ inserted.

As you seem to be new to latex, you need to add $ around V_{0}, to enter the math-mode, like such:

\documentclass{article}

\usepackage{graphicx}
\begin{document}

\section{Tabulation}
\subsection{2nd Order Low pass Filter}
\resizebox{\textwidth}{!}{\begin{tabular}{|c|c|}
\hline
 Frequency(f, in Hz)& $V_{0}$(in Volts)  \\ \hline
 100& 1.575   \\ \hline
 300& 1.58\\ \hline
 500& 1.59  \\ \hline
  700& 1.534 \\ \hline
 900& 1.39 \\ \hline
 1000& 1.32  \\ \hline
  1.1K & 1.26  \\ \hline
   1.2K& 1.06 \\ \hline
   1.5K& 865.037mV  \\ \hline
 2K & 509.503mV \\ \hline\\
 4K & 141.045mV   \\ \hline
  6K & 62.824mV  \\ \hline\\

 \end{tabular}}%
\end{document}

Then it works fine for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .