0

I need tiny help! My latex table is not getting formatting Properly! Anyone can help me How I can fix the issue?

Latex Code is

\begin{table}
\centering
\caption{Hardness comparison}
\begin{tabular}{|c|c|c|c|c|c|} 
\hline
\begin{tabular}[c]{@{}c@{}}\textbf{BFO} \\\textbf{K\_\$\{IC\}\$(MPa.m\textsuperscript{0.5})} \\\textbf{Niihara´s eq.} \\\textbf{~}\end{tabular} & \begin{tabular}[c]{@{}c@{}}\textbf{BLFO} \\\textbf{\textbf{K\_\$\{IC\}\$}(MPa.m\textsuperscript{0.5})} \\\textbf{Niihara´s eq.}\end{tabular} & \begin{tabular}[c]{@{}c@{}}\textbf{BFNbO} \\\textbf{\textbf{K\_\$\{IC\}\$}(MPa.m\textsuperscript{0.5})} \\\textbf{Niihara´s eq.}\end{tabular} & \begin{tabular}[c]{@{}c@{}}\textbf{BFO} \\\textbf{\textbf{K\_\$\{IC\}\$}~(MPa.m\textsuperscript{0.5})} \\\textbf{Anistis´s eq.}\end{tabular} & \begin{tabular}[c]{@{}c@{}}\textbf{BLFO} \\\textbf{\textbf{K\_\$\{IC\}\$}~(MPa.m\textsuperscript{0.5})} \\\textbf{Anistis´s eq.}\end{tabular} & \begin{tabular}[c]{@{}c@{}}\textbf{BFNbO} \\\textbf{\textbf{K\_\$\{IC\}\$}~(MPa.m\textsuperscript{0.5})} \\\textbf{Anistis´s eq.}\end{tabular}  \\ 
\hline
0.19                                                                                                                                            & 0.10                                                                                                                                         & 0.04                                                                                                                                          & 0.18                                                                                                                                         & 0.08                                                                                                                                          & 0.04                                                                                                                                            \\ 
\hline
0.25                                                                                                                                            & 0.09                                                                                                                                         & 0.22                                                                                                                                          & 0.17                                                                                                                                         & 0.07                                                                                                                                          & 0.16                                                                                                                                            \\ 
\hline
0.19                                                                                                                                            & 0.37                                                                                                                                         & 0.09                                                                                                                                          & 0.17                                                                                                                                         & 0.24                                                                                                                                          & 0.08                                                                                                                                            \\ 
\hline
0.27                                                                                                                                            & 0.28                                                                                                                                         & 0.29                                                                                                                                          & 0.27                                                                                                                                         & 0.28                                                                                                                                          & 0.28                                                                                                                                            \\
\hline
\end{tabular}
\end{table}

Table issue

leandriis
  • 62,593

2 Answers2

3

Table, as you have now, if far to wide that can be fit on page. Also in firsr row you in each cell repeat data \textbf{K\_\$\{IC\}\$(MPa.m\textsuperscript{0.5}). You may consider to move this for example in caption of table, for example as >I done in MWE below (well, context and meaning of table headers is unknown to me, so you probably should rephrase caption text).

By use of the tabularray package with siunitx library (which load siunitx package), you can write your document example as follows:

\documentclass{book}
\usepackage[showframe]{geometry}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}

\usepackage{lipsum}

\begin{document} \lipsum[1] \begin{table}[ht] \caption{Comparison of the K_IC hardness measured in (\unit{\mega\pascal\sqrt{m}})} \begin{tblr}{hlines, vlines, colspec = {*{6}{X[c, si ={table-format=1.2}]}}, colsep = 4pt, row{1} = {font=\small\bfseries} } {{{BFO\ Niihara´s eq.}}} & {{{BLFO\ Niihara´s eq.}}} & {{{BFNbO\ Niihara´s eq.}}} & {{{BFO\ Anistis´s eq.}}} & {{{BLFO\ Anistis´s eq.}}} & {{{BFNbO\ Anistis´s eq.}}} \ 0.19 & 0.10 & 0.04 & 0.18 & 0.08 & 0.04 \ 0.25 & 0.09 & 0.22 & 0.17 & 0.07 & 0.16 \ 0.19 & 0.37 & 0.09 & 0.17 & 0.24 & 0.08 \ 0.27 & 0.28 & 0.29 & 0.27 & 0.28 & 0.28 \ \end{tblr} \end{table} \end{document}

enter image description here

If suggested solution is not acceptable to you, the only reasonable option is rotate table into landscape orientation.

Zarko
  • 296,517
3

You really need to simplify the header cells, as they contain lots of redundancies that make them unreadable and the table much too wide.

I suggest something like the following.

enter image description here

\documentclass{article}
\usepackage{array,booktabs,siunitx}
\usepackage[flushleft]{threeparttable}
\begin{document}
\begin{table}
\centering
\begin{threeparttable}
\caption{Hardness comparison\tnote{*}}
\begin{tabular}{@{} cccccc @{}} 
\toprule
\multicolumn{3}{@{}c}{Niihara's eq.} & 
\multicolumn{3}{c@{}}{Anistis's eq.} \\
\cmidrule(r){1-3} \cmidrule(l){4-6}
BFO & BLFO & BFNbO & BFO & BLFO & BFNbO \\
\midrule
0.19 & 0.10 & 0.04 & 0.18 & 0.08 & 0.04 \\ 
0.25 & 0.09 & 0.22 & 0.17 & 0.07 & 0.16 \\ 
0.19 & 0.37 & 0.09 & 0.17 & 0.24 & 0.08 \\ 
0.27 & 0.28 & 0.29 & 0.27 & 0.28 & 0.28 \\
\bottomrule
\end{tabular}

\footnotesize \begin{tablenotes} \item[*] K_${IC}$(MPa.m\textsuperscript{0.5}), or maybe K\textsubscript{IC} (\unit{\mega\pascal\meter\tothe {0.5}}) \end{tablenotes} \end{threeparttable}

\end{table} \end{document}

Mico
  • 506,678