1
\begin{table}[ht]

\caption{Table 5.1: Case studied depending on pre-chamber pressure and CVC chamber fuel blends}

\begin{center}
\begin{tabular}{|c|c|c|}
\hline
Case Number&Pre-chamber Pressure (bar)&CVC chamber fuel blends (by volume)\\
\hline
5.1&2&Fuel-B, 50:50 CH$_{4}$-H$_{2}$ blend\\
\hline
5.2&2&Fuel-A, 30:70 CH$_{4}$-H$_{2}$ blend\\
\hline
5.3&4&Fuel-B, 50:50 CH$_{4}$-H$_{2}$ blend\\
\hline
5.4&4&Fuel-A, 30:70 CH$_{4}$-H$_{2}$ blend\\
\hline
5.5&6&Fuel-B, 50:50 CH$_{4}$-H$_{2}$ blend\\
\hline
5.6&6&Fuel-A, 30:70 CH$_{4}$-H$_{2}$ blend\\
\hline



\end{tabular}

\end{center}

\label{tab:multicol}

\end{table}
\\
\\
\\
\\
\\
\\\
\\

\begin{table}[ht]

\caption{Table 5.2. Thermodynamic properties and mass fraction}

\begin{center}

\begin{tabular}{|c|c|c|c|c|}

\hline

\multirow{Mass fraction, Y} &
\multicolumn{2}{c} 
%{\hspace*{-3.5mm} \hspace*{3mm} 
{Pre-chamber } \vline 
&
\multirow{CVC chamber}
%\vline 
&
\multirow{nozzle}
\\
\cline{2-3}

    &   Case 4.1 Reactive
 & Case 4.2 Inert H
 %& Case 4.3 Inert U
 \\
 \hline
He&0&0.0905&0.2152&0\\
\hline
CH_{4}&0&0&0&0.0552\\
\hline
Ar&1.21e-2&0.2248&0.4755&0\\
\hline
CO&3.40e-2&0&0&0\\
\hline
CO_{2}&1.11e-1&0&0&0\\
\hline
H&6.08e-5&0&0&0\\
\hline
H_{2}&1.01e-3&0&0&0\\
\hline
H$_{2}${O}&1.23e-1&0&0&0\\
\hline
NO&3.31e-3&0&0&0\\
\hline
N_{2}&7.08e-1&0.6847&0.3092&0.7247\\
\hline
O&2.41e-4&0&0&0\\
\hline
OH&3.64e-3&0&0&0\\
\hline
O_{2}&2.65e-3&0&0&0.2201\\
\hline
Temperature(K)&2670&2670&2670&300\\
\hline
Pressure(bar)&6&6&6&1\\
\hline
\end{tabular}

\end{center}

\label{tab:multicol}


\end{table}

not showing vertical lines at the first row last 2 columns

1

The multirow-command takes three parameters usually (How many rows there should be spanned, the width of the content and whats to be printed). You must also remember to use the tabular-environment correctly. You forgot to add two & in the row containing the missing vertical bar. The bar is missing because \\ ends the table at that point in the column.

Changed code to a MWE with previously not working table:

\documentclass{article}

\usepackage{multirow}

\begin{document}

\begin{table}[ht]

\caption{Table 5.2. Thermodynamic properties and mass fraction}

\begin{center}

\begin{tabular}{|c|c|c|c|c|}

\hline

\multirow{2}{*}{Mass fraction, Y} & \multicolumn{2}{c}{Pre-chamber } \vline &\multirow{2}{*}{CVC chamber}&\multirow{2}{*}{nozzle} \\
\cline{2-3}
    &   Case 4.1 Reactive & Case 4.2 Inert H &&\\
\hline
He&0&0.0905&0.2152&0\\
\hline
$CH_{4}$&0&0&0&0.0552\\
\hline
Ar&1.21e-2&0.2248&0.4755&0\\
\hline
CO&3.40e-2&0&0&0\\
\hline
$CO_{2}$&1.11e-1&0&0&0\\
\hline
H&6.08e-5&0&0&0\\
\hline
$H_{2}$&1.01e-3&0&0&0\\
\hline
$H_{2}${O}&1.23e-1&0&0&0\\
\hline
NO&3.31e-3&0&0&0\\
\hline
$N_{2}$&7.08e-1&0.6847&0.3092&0.7247\\
\hline
O&2.41e-4&0&0&0\\
\hline
OH&3.64e-3&0&0&0\\
\hline
$O_{2}$&2.65e-3&0&0&0.2201\\
\hline
Temperature(K)&2670&2670&2670&300\\
\hline
Pressure(bar)&6&6&6&1\\
\hline
\end{tabular}

\end{center}

\label{tab:multicol}


\end{table}
\end{document}

Current output: enter image description here

1

While your problem was fixed (\multirow requires 3 arguments), I would honestly change your table to improve its readability. These are the changes I'd do:

  1. Get rid of all the vertical rules and most of the horizontal ones, and switch to the booktabs package.
  2. Align the numerical values at the decimal point using the dcolumn package and setting a new column type.
  3. If you want you can add alternate grey lines to make it easier to read the rows. You won't see this in my output below, but in case you want to see, you can uncomment (remove the % before it) the command %\rowcolors{3}{gray!5}{white}.

I also moved the caption below the table, but feel free to move it according to your preference (although I have typically seen it below).

Output

figure 1

Code

\documentclass{article}
\usepackage{booktabs, dcolumn}
\usepackage{multirow,array}
\usepackage{geometry}
\usepackage[table]{xcolor}

\newcolumntype{.}{D{.}{.}{-1}}

\begin{document}
\begin{table}[h!]
    \centering
    %\rowcolors{3}{gray!5}{white}
\begin{tabular}{r.*{4}{.}}
\toprule
\multirow{2}{*}{Mass fraction, Y} & \multicolumn{2}{c}{Pre-chamber} & \multicolumn{1}{c}{\multirow{2}{*}{CVC chamber}} & \multicolumn{1}{c}{\multirow{2}{*}{nozzle}} \\
 & \multicolumn{1}{c}{Case 4.1 Reactive} & \multicolumn{1}{c}{Case 4.2 Inert H} & & \\ \midrule
He & 0 & 0.0905 & 0.2152 & 0 \\
CH$_{4}$ & 0 & 0 & 0 & 0.0552 \\
Ar & 1.21e-2 & 0.2248 & 0.4755 & 0 \\
CO & 3.40e-2 & 0 & 0 & 0 \\ 
CO$_{2}$ & 1.11e-1 & 0 & 0 & 0 \\
H & 6.08e-5 & 0 & 0 & 0 \\
H$_{2}$ & 1.01e-3 & 0 & 0 & 0 \\
H$_{2}${O} & 1.23e-1 & 0 & 0 & 0 \\
NO & 3.31e-3 & 0 & 0 & 0 \\
N$_{2}$ & 7.08e-1 & 0.6847 & 0.3092 & 0.7247 \\
O & 2.41e-4 & 0 & 0 & 0 \\
OH & 3.64e-3 & 0 & 0 & 0 \\
O$_{2}$ & 2.65e-3 & 0 & 0 & 0.2201 \\
Temperature (K) & 2670 & 2670 & 2670 & 300 \\
Pressure (bar) & 6 & 6 & 6 & 1 \\ \bottomrule
\end{tabular}
\caption{Table 5.2. Thermodynamic properties and mass fraction}
\label{tab:multicol}
\end{table}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.