7

Though I adjusted the width of the table, a part of it is open, as shown in the picture. The code is attached. Kindly help me. I have faced this issue before as well, so kindly tell why this arises typically. Table

$\begin{tabular}[H]{|p{0.15\textwidth}|p{0.07 \textwidth}|p{0.07 \textwidth}|p{0.07 \textwidth}|}
\hline
Parameters & Si CMOS & 4H-SiC CMOS& GaN HEMT\\
 & \\
\hline
Critical Electrical Field (MV/cm) & 0.3 & 3 & 3.5\\
\hline
Energy Bandgap (eV) & 1.12 & 3.23 & 3.4 \\
\hline
Electron Mobility ( \ $ cm^2/(V s) $ & 500 & 35 & 1500 \\
\hline
Electron Saturation Velocity ($10^7 cm/s $) & 1 & 1.8 & 3.4\\
\hline
Thermal Conductivity (W/(K cm)) & 1.3& 3.7 & 1.5 \\
\hline
Melting Point (K) & 1412 & 3103 & 2500 \\
\hline

\end{tabular}\\
3
  • 1
    Welcome to TeX.SE.
    – Mico
    Commented Apr 8, 2023 at 0:14
  • 4
    & \\ is a 2-cell row, you want & & & \\ Commented Apr 8, 2023 at 0:17
  • Or, just delete the ` & \` line.
    – Mico
    Commented Apr 8, 2023 at 0:17

2 Answers 2

8

Beside use siunitx (omitted here in order to not mess the MWE) to fit the width of the whole table without headaches, consider use tabulary or tabularx (in this case, better the first) and on the other hand, avoid vertical rules using booktabs, not to hide cell gaps, but to improve it to a more readable formal style (not just a matter of taste, as this is mandatory style standard in many journals because is more readable).

mwe

\documentclass[twocolumn]{article}
\usepackage{tabulary}
\usepackage{booktabs} %\defaultaddspace1em
\begin{document}
\begin{tabulary}{\linewidth}{@{}LCCC@{}}
\toprule\vspace{0pt} 
Parameters & Si CMOS & 4H-SiC  CMOS& GaN HEMT\\\midrule
Critical Electrical Field    (MV/cm) & 0.3 & 3 & 3.5\\\addlinespace
Energy Bandgap (eV) & 1.12 & 3.23 & 3.4 \\\addlinespace
Electron Mobility (cm\textsuperscript{2}/(V s)) & 500 & 35 & 1500 \\\addlinespace
Electron Saturation Velocity ($10^7$ cm/s) & 1 & 1.8 & 3.4\\\addlinespace
Thermal Conductivity (W/(K cm)) & 1.3& 3.7 & 1.5 \\\addlinespace
Melting Point (K) & 1412 & 3103 & 2500 \\\bottomrule
\end{tabulary}
\end{document}
8

To fill in the gaps in two of the four vertical lines, you need to change the line & \\ located immediately below the header line to & & & \\. Or, just delete this line.

I would also recommend that you use the machinery of the siunitx package -- specifically, its \unit and \qty macros -- to typeset scientific units and their associated quantities.

And, instead of setting the column widths as a fraction of the overall width of the text block (the parameter \textwidth varies from document class to document class), I'd choose the column widths based on the absolute width of specific words that need to fit unbroken in a cell. In the code below, that's "4H-SiC" for the three data columns. For the left-hand column, two possible widths are considered: "Conductivity" for the table shown in the upper part, and "Critical Electrical " for the table in the lower part. The tables' overall widths aren't hugely different; however, their total heights -- 21 rows in the upper table, and only 14 in the lower table -- differ considerably.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage{array}      % for 'm' column type
\usepackage{ragged2e}   % for '\RaggedRight` macro
\usepackage[per-mode=symbol]{siunitx} % for '\unit' and '\qty' macros

\setlength\extrarowheight{2pt} % for a less cramped "look"

%% determine widths of column 1 and columns 2 thru 4
\newlength\mylenAa
\settowidth\mylenAa{Conductivity}
\newlength\mylenAb
\settowidth\mylenAb{Critical Electrical }
\newlength\mylenB
\settowidth\mylenB{4H-SiC}

\begin{document}

\begin{center}
% version 1
\begin{tabular}{|>{\raggedright}m{\mylenAa}|
                 >{\centering}m{\mylenB}|
                 >{\centering}m{\mylenB}|
                 >{\centering\arraybackslash}m{\mylenB}|}
\hline
Parameters & Si CMOS & 4H-SiC CMOS& GaN HEMT\\
% & & & \\ % <-- two more instances of "&"
\hline
Critical Electrical Field 
(\unit{\mega\volt\per\centi\meter}) & 0.3 & 3.0 & 3.5\\
\hline
Energy Bandgap 
(\unit{\electronvolt}) & 1.12 & 3.23 & 3.4 \\
\hline
Electron Mobility 
(\unit{\centi\meter\squared\per\volt\per\second}) & 500 & 35 & 1500 \\
\hline
Electron Saturation Velocity 
(\qty{e7}{\centi\meter\per\second}) & 1.0 & 1.8 & 3.4\\
\hline
Thermal Conductivity 
(\unit{\watt\per\kelvin\per\centi\meter}) & 1.3& 3.7 & 1.5 \\
\hline
Melting Point 
(\unit{\kelvin}) & 1412 & 3103 & 2500 \\
\hline
\end{tabular}


\bigskip
% version 2
\begin{tabular}{|>{\RaggedRight}m{\mylenAb}| % <-- bigger width
                 >{\centering}m{\mylenB}|
                 >{\centering}m{\mylenB}|
                 >{\centering\arraybackslash}m{\mylenB}|}
\hline
Parameters & Si CMOS & 4H-SiC CMOS& GaN HEMT\\
\hline
Critical Electrical Field 
(\unit{\mega\volt\per\centi\meter}) & 0.3 & 3.0 & 3.5\\
\hline
Energy Bandgap 
(\unit{\electronvolt}) & 1.12 & 3.23 & 3.4 \\
\hline
Electron Mobility 
(\unit{\centi\meter\squared\per\volt\per\second}) & 500 & 35 & 1500 \\
\hline
Electron Saturation Velocity 
(\qty{e7}{\centi\meter\per\second}) & 1.0 & 1.8 & 3.4\\
\hline
Thermal Conductivity 
(\unit{\watt\per\kelvin\per\centi\meter}) & 1.3& 3.7 & 1.5 \\
\hline
Melting Point 
(\unit{\kelvin}) & 1412 & 3103 & 2500 \\
\hline
\end{tabular}
\end{center}

\end{document}

You must log in to answer this question.

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