I am trying to make a table with lots of columns. I specify width of each column. However, my text in column is overlapping the neighbouring column instead of going to new row.
How do I solve it?
See attached picture:
Code is as follows:
\begin{table}[h]
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\setlength\extrarowheight{5pt}
\scriptsize
\centering
\begin{tabular}{P{0.7 cm} P{0.9cm} P{1cm} P{2 cm} P{0.4cm} P{1.2cm}
P{0.4cm} P{0.8cm} P{0.5cm} P{0.9cm} }
Ref & IL & H$\kappa$ & $D_{it}$ & $C_{ox}(\mu F/cm^2)$ & Technique &
$\sigma$ & Sn & Strain & Device \\
\hline
\cite{gong2012towards} & $SiO_2/Si$ & 3.6 nm Hf$O_2$ & $1.7 \times 10^{12}$(MG) & 2.2 & CP & - & 3\% & F.S & p-FET \\
\hline
\end{tabular}
\caption{No Caption} \label{table: No label}
\end{table}
Best Answer
I suggest you use a
tabularx
environment, to ensure that the material will fit inside the text block, with a centered version of the package'sX
column for 5 or the 10 columns, to allow automatic line-wrapping if needed. I would also like to suggest that you use the macros of thesiunitx
package to typeset units and numbers. Finally, do use the line-drawing macros of thebooktabs
package to obtain well-spaced lines.Addendum, posted after the OP left a comment that line-breaks weren't acceptable. If linebreaks aren't acceptable, and if you're not willing to switch to an extremely small font size (which, in my view, you shouldn't do anyway), the main option that's left is to switch to a landscape-oriented table. The following example employs a
sidewaystable
environment, and it uses atabular*
environment instead of atabularx
environment, as automatic text wrapping isn't supposed to happen.