How can I left-align the following table and center the heading and number of pages?
Also, currently the lines within the table have disappeared and the table should be covering the whole page...
(as this is my first post, the picture cannot be shown here due to stackoverflow policy, see the link below)
Thanks in advance for your smart help! :)
\KOMAoptions{paper={landscape},pagesize}
\recalctypearea
\hypertarget{Systeme}{\section{Gängige Systeme}}
\begin{table}[!h]
\resizebox{\columnwidth}{!}{%
\begin{tabularx}{15cm}{|l|l|l|l|l|l|l|l|l|l}
\hline
\textbf{Name} &
\textbf{XR-type} &
\textbf{Standalone} &
\textbf{Jahr} &
\textbf{Preis} &
\textbf{Display} &
\textbf{Sehwinkel} &
\textbf{Auflösung /Auge} &
\textbf{Bildrate} &
\multicolumn{1}{l|}{Sonstiges} \\ \hline
Oculus Quest 2 &
VR &
ja &
2020 &
\$299 &
Single Fast switch LCD &
\begin{tabular}[c]{#{}l#{}}97° horizontal\\ 93° vertical\end{tabular} &
1832x1920 &
120 Hz &
\\ \cline{1-9}
Pico Neo 3 Link &
VR &
ja &
2022 &
\$449 &
Single LCD &
\begin{tabular}[c]{#{}l#{}}98° horizontal\\ 90° vertical\end{tabular} &
1832x1920 &
90 Hz &
\\ \hline
VRgineers XTAL 3 Mixed Reality &
MR &
nein &
2022 &
\$11500 &
2 x LCD &
\begin{tabular}[c]{#{}l#{}}180° horizontal\\ 90° vertical\end{tabular} &
3840x2160 &
120 Hz &
\multicolumn{1}{l|}{6 DoF Inside-out} \\ \hline
VRgineers XTAL 3 &
VR &
nein &
&
\$8900 &
2 x LCD &
\begin{tabular}[c]{#{}l#{}}180° horizontal\\ 90° vertical\end{tabular} &
3840x2160 &
120 Hz &
\\ \cline{1-9}
Dream Glass Lead Pro &
AR &
ja &
2022 &
\$1199 &
&
90° diagonal &
1920x1080 &
&
\\ \cline{1-9}
Tilt Five &
AR &
nein &
2021 &
\$359 &
2 x LCoS &
110° diagonal &
1280x720 &
&
\\ \cline{1-9}
Lenovo ThinkReality A3 &
AR &
nein &
2021 &
\$1499 &
&
&
1920x1080 &
&
\\ \cline{1-9}
HTC Vive Flow &
VR &
ja &
2021 &
\$499 &
2 x LCD &
100° diagonal &
1600x1600 &
75 Hz &
\\ \hline
Huawei VR Glass 6DoF &
MR &
nein &
2021 &
\$620 &
2 x LCD &
90° diagonal &
1600x1600 &
90 Hz &
\multicolumn{1}{l|}{6 DoF Inside-out via 2 Kameras} \\ \hline
\end{tabularx}%
}
\end{table}
First of all, please make sure you provide the full code that anyone can compile and test. It's usually not even possible to help without it!
Your table is simply too wide. The only sensible way to fit it within a page is to change wording; sometimes breaking into multiple lines can be enough. For the latter, inner tabular is OK but I would suggest makecell package.
The culprits are headings and repeated information (horizontal, vertical or diagonal). I'd change long headings to acronyms and add annotations at the bottom unless a particular heading name is already short or takes similar space as most of the cell content.
Here's the proposed example:
and the code:
\documentclass{article}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{booktabs}
\usepackage{makecell}
\renewcommand{\tabularxcolumn}[1]{m{#1}}
\NewDocumentCommand\xtnote{sm}{\def\tss{\textsuperscript{#2}}\IfBooleanTF{#1}{\tss}{\rlap{\tss}}}
\newcommand\emspace{\hspace{0.75em}}
\renewcommand\theadfont{\bfseries}
\renewcommand\cellalign{cc}
\renewcommand\theadalign{cc}
\begin{document}
\begin{sidewaystable}
\setlength\tabcolsep{4pt}
\begin{tabularx}{\textwidth}{l *8{c} X}
\toprule
\thead[l]{Name} &
\thead{XR\\type} &
\thead{ST\,\xtnote{1}} & % Standalone
\thead{Jahr} &
\thead{Preis} &
\thead[l]{Display} &
\thead{SE\,\xtnote{2}} & % Sehwinkel
\thead{Auflösung\\Auge} &
\thead{Bildrate} &
\thead{Sonstiges} \\\midrule
Oculus Quest 2 &
VR &
ja &
2020 &
\$299 &
\makecell{Single Fast\\switch LCD} &
\makecell{97° \xtnote{h}\\93° \xtnote{v}} &
1832x1920 &
120 Hz & \\
Pico Neo 3 Link &
VR &
ja &
2022 &
\$449 &
Single LCD &
\makecell{98° \xtnote{h}\\90° \xtnote{v}} &
1832x1920 &
90 Hz & \\
\makecell[l]{VRgineers XTAL 3\\Mixed Reality} &
MR &
nein &
2022 &
\$11500 &
2 x LCD &
\makecell{180° \xtnote{h}\\90° \xtnote{v}} &
3840x2160 &
120 Hz &
6 DoF Inside-out \\
VRgineers XTAL 3 &
VR &
nein &
&
\$8900 &
2 x LCD &
\makecell{180° \xtnote{h}\\90° \xtnote{v}} &
3840x2160 &
120 Hz & \\
Dream Glass Lead Pro &
AR &
ja &
2022 &
\$1199 & &
90° \xtnote{d} &
1920x1080 & & \\
Tilt Five &
AR &
nein &
2021 &
\$359 &
2 x LCoS &
110° \xtnote{d} &
1280x720 & & \\
Lenovo ThinkReality A3 &
AR &
nein &
2021 &
\$1499 & & &
1920x1080 & & \\
HTC Vive Flow &
VR &
ja &
2021 &
\$499 &
2 x LCD &
100° \xtnote{d} &
1600x1600 &
75 Hz & \\
Huawei VR Glass 6DoF &
MR &
nein &
2021 &
\$620 &
2 x LCD &
90° \xtnote{d} &
1600x1600 &
90 Hz &
6 DoF Inside-out via 2 Kameras \\\midrule
\multicolumn{10}{l}{%
\xtnote*{1} Standalone,\qquad\xtnote*{2} Sehwinkel,\qquad
\xtnote*{h} horizontal,\qquad\xtnote*{v} vertical,\qquad\xtnote*{d} diagonal}
\end{tabularx}
\end{sidewaystable}
\end{document}
Related
As you can see here, same picture insert (Apple logo) on this table, but result is different.
here is the code :
\begin{longtblr}{
colspec={Q[valign=b]Q[valign=b]Q[valign=h]},
row{1}={halign=c},
row{2}= {halign=C},
row{3}= {halign=C},
vlines,
hlines
}
\textbf{Id} & \textbf{Name} & \textbf{Figure} \\
1 & Press an imaginary button & \includegraphics[scale=0.25]{gesture/Button1.png}\\ \hline
2 & Double press an imaginary button & \includegraphics[scale=0.25]{gesture/test.png}\\ \hline
3 & Close the fist & \includegraphics[scale=0.25]{gesture/closeFist.PNG} \\ \hline
4 & Open the fist & \includegraphics[scale=0.25]{gesture/openFist.PNG} \\ \hline
5 & Touch the ring & \includegraphics[scale=0.25]{gesture/test.PNG} \\ \hline
6 & Touch 2 times the ring & \includegraphics[scale=0.15]{gesture/touchRing2.PNG} \\ \hline
\end{longtblr}
I would like to center all the picture of the tab, if somoene have a solution.
With
row{2}= {halign=C},
row{3}= {halign=C},
you are only centring the rows with ID 1 and 2. If you also want all the other images centred, change the halign of the entire column instead of doing this for individual rows.
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabularray}
\begin{document}
\begin{longtblr}{
colspec={Q[valign=b]Q[valign=b]Q[valign=h,halign=C]},
row{1}={halign=c},
% row{2}= {halign=C},
% row{3}= {halign=C},
vlines,
hlines
}
\textbf{Id} & \textbf{Name} & \textbf{Figure} \\
1 & Press an imaginary button & \includegraphics[width=3cm,height=1cm]{example-image-duck}\\ \hline
2 & Double press an imaginary button & \includegraphics[scale=0.25]{example-image-duck}\\ \hline
3 & Close the fist & \includegraphics[scale=0.25]{example-image-duck} \\ \hline
4 & Open the fist & \includegraphics[scale=0.25]{example-image-duck} \\ \hline
5 & Touch the ring & \includegraphics[scale=0.25]{example-image-duck} \\ \hline
6 & Touch 2 times the ring & \includegraphics[scale=0.15]{example-image-duck} \\ \hline
\end{longtblr}
\end{document}
I have made a table with multiple columns and rows arguments like this
\begin{table}[H]
\centering
\begin{tabular}{lccccc}
\hline
\multirow{2}{*}{Aspects} & Probability & \multicolumn{4}{c}{Methods} \\
\cline{3-6}
& for DE Genes & Binomial Test & Tangram & stereoscope & BayesPrism\\
\hline
\multirow{3}{*}{AUC} & 0.3 & 0.867 & 0.029 & 0.074 & 0.992 \\
& 0.1 & 0.722 & 0.023 & 0.015 & 0.987\\
& 0.05 & 0.512 & 0.055 & 0.025 & 0.972\\
\hline
\multirow{3}{*}{Best Thresholds} & 0.3 & ${0.135$ & 0.029 & 0.072 & $1e-10$ \\
& 0.1 & ${1e-60$ & 0.026 & 0.065 & $1e-10$\\
& 0.05 & $1e-60$ & 0.033 & 0.069 & $1e-10$\\
\hline
\end{tabular}
\caption{The ROC Curve Summary for Data with 15 Clusters}
\label{15 cluster summary}
\end{table}
It will give the results like this
I want to make the entries "Best Thresholds" be in two rows (filling 3 rows arguments) so that the table is not too wide. Could anyone helps how to make it?
You can place the text in a \parbox:
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{lccccc}
\hline
\multirow{2}{*}{Aspects} & Probability & \multicolumn{4}{c}{Methods} \\
\cline{3-6}
& for DE Genes & Binomial Test & Tangram & stereoscope & BayesPrism\\
\hline
\multirow{3}{*}{AUC} & 0.3 & 0.867 & 0.029 & 0.074 & 0.992 \\
& 0.1 & 0.722 & 0.023 & 0.015 & 0.987\\
& 0.05 & 0.512 & 0.055 & 0.025 & 0.972\\
\hline
\multirow{3}{*}{\parbox{2cm}{\raggedright Best Thresholds}} & 0.3 & $0.135$ & 0.029 & 0.072 & $1e-10$ \\
& 0.1 & $1e-60$ & 0.026 & 0.065 & $1e-10$\\
& 0.05 & $1e-60$ & 0.033 & 0.069 & $1e-10$\\
\hline
\end{tabular}
\caption{The ROC Curve Summary for Data with 15 Clusters}
\label{15 cluster summary}
\end{table}
\end{document}
I have a table in Overleaf. I want to remove the horizontal line (crossing the number 0.3). I know I can use \cline{} command to remove some horizontal lines, but I do not know how to use the combination of them.
\begin{tabular}{l|c|c|c|c|c}
\hline
\multirow{2}{*}{Aspects} & Probability & \multicolumn{4}{c}{Methods} \\
\cline{3-6}
& for DE Genes & Binomial Test & Tangram & stereoscope & BayesPrism\\
\cline{3-6}
AUC & \multirow{2}{*}{0.3} & 0.519 & -0.261 & -0.020 & 0.996 \\
\cline{1-2}
\cline{3-6}
Best thresholds & &$0.398$ & $0.019$ & 0.204 & ${\rm e}^{-50}$\\
\hline
\end{tabular}
\caption{The ROC Curve Summary for Data with 5 Clusters with Probability 0.05 for DE
Genes}
\label{5 cluster 0.05}
\end{table}
The table looks like this.
If you want the line only in the first column, use \cline{1-1} instead of \cline{1-2} which will draw it over the first two columns.
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{tabular}{l|c|c|c|c|c}
\hline
\multirow{2}{*}{Aspects} & Probability & \multicolumn{4}{c}{Methods} \\
\cline{3-6}
& for DE Genes & Binomial Test & Tangram & stereoscope & BayesPrism\\
\cline{3-6}
AUC & \multirow{2}{*}{0.3} & 0.519 & -0.261 & -0.020 & 0.996 \\
\cline{1-1}
\cline{3-6}
Best thresholds & &$0.398$ & $0.019$ & 0.204 & ${\rm e}^{-50}$\\
\hline
\end{tabular}
\end{document}
This code:
\subsection*{4.1 1NF}
No, this table is not in 1NF as column Info can and on multiple rows hold multiple values. 1NF Variation would be:
\par
\begin{table}[]
\begin{tabular}{|l|l|l|l|l|l|}
\hline
{\ul \textbf{Student\_ID}} & \textbf{First Name} & \textbf{Last Name} & \textbf{Course} & \textbf{Credits} & \textbf{Grade} \\ \hline
1 & Adam & Brown & Databases & 5 & 8 \\ \hline
1 & Adam & Brown & Algebra & 3 & 7 \\ \hline
1 & Adam & Brown & Algorithms & 5 & 9 \\ \hline
2 & Felicia & Green & Algebra & 3 & 10 \\ \hline
2 & Felicia & Green & Programming & 5 & 6 \\ \hline
3 & Mary & Grey & Databases & 5 & 9 \\ \hline
3 & Mary & Grey & Algorithms & 5 & 7 \\ \hline
3 & Mary & Grey & Web & 3 & 10 \\ \hline
1 & Adam & Brown & Physics & 3 & 10 \\ \hline
\end{tabular}
\end{table}
Produces this result:
Rednder of the LaTeX code above
But I need the table to be after the text.
Can someone tell me what am I doing wrong?
You're missing a floating specifier, e.g. to allow the table [h]ere, at the [t]op, at the [b]ottom or on a separate [p]age:
\begin{table}[htbp]
I a trying to put a table in my report. I want to place it in the middle of the page.
but it is shifted to the right side. How can I fix it? (I am using overleaf)
I really appreciate it if anyone could help me to fix the problem.
This is the code:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{tabularx}
\usepackage{caption}
\begin{table}[p]
\centering
\small
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
\textbf{Sub fault} & \textbf{Lat} & \textbf{Lon} & \textbf{\begin{tabular}[c]{#{}c#{}}Depth\\ (Km)\end{tabular}} & \textbf{\begin{tabular}[c]{#{}c#{}}Strike\\ (Deg.)\end{tabular}} & \textbf{\begin{tabular}[c]{#{}c#{}}Dip \\ (Deg.)\end{tabular}} & \textbf{\begin{tabular}[c]{#{}c#{}}Length\\ (Km)\end{tabular}} & \textbf{\begin{tabular}[c]{#{}c#{}}Width\\ (Km)\end{tabular}} & \textbf{\begin{tabular}[c]{#{}c#{}}Rake \\ (Deg.)\end{tabular}} & \textbf{\begin{tabular}[c]{#{}c#{}}Slip (m)\\ Mw=9.0\end{tabular}} \\ \hline
\textbf{1} & 18.9848 & -65.6921 & 22.1 & 89.59 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{2} & 19.4069 & -65.6953 & 5 & 89.59 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{3} & 18.9484 & -66.5742 & 22.1 & 84.98 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{4} & 19.3688 & -66.6133 & 5 & 84.98 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{5} & 18.8738 & -67.5412 & 22.1 & 85.87 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{6} & 19.2948 & -67.5734 & 5 & 85.87 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{7} & 18.7853 & -68.4547 & 22.1 & 83.64 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{8} & 19.2048 & -68.5042 & 5 & 83.64 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{9} & 18.8870 & -63.8800 & 22.1 & 95.37 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{10} & 19.3072 & -63.8382 & 5 & 95.37 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{11} & 18.9650 & -64.8153 & 22.1 & 94.34 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{12} & 19.3859 & -64.7814 & 5 & 94.34 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{13} & 18.0566 & -61.5491 & 17.94 & 112.84 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{14} & 18.4564 & -61.3716 & 5 & 112.34 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{15} & 18.4149 & -62.4217 & 17.94 & 117.86 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{16} & 18.7985 & -62.2075 & 5 & 117.86 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{17} & 18.7844 & -63.1649 & 17.94 & 110.46 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{18} & 19.1798 & -63.0087 & 5 & 110.46 & 20 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{19} & 16.4535 & -59.9029 & 17.94 & 136.99 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{20} & 16.7494 & -59.5716 & 5 & 136.99 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{21} & 17.0903 & -60.5996 & 17.94 & 138.71 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{22} & 17.3766 & -60.2580 & 5 & 138.71 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{23} & 17.8560 & -61.1559 & 17.94 & 141.07 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\textbf{24} & 18.1286 & -60.8008 & 5 & 141.07 & 15 & 100 & 50 & 90 & 7.4 \\ \hline
\end{tabular}
\captionsetup{justification=centering}
\caption{\label{tab:table-name}source parameters for a Mw 9.0 PRT co-seismic source based on 24 sub-faults (Gica eal,2008). Corresponding surface elevation computed with Okadas (1985) method is shown in fig 3}
\end{table}
\clearpage
Your issue here is that the table is too wide to fit within the text block. As such, LaTeX pushes is against the left margin and let it overflow into the right margin. If you don't want to change anything and just centre it, you can wrap the entire tabular inside a \makebox[\linewidth]:
\begin{table}
\centering
\small
\makebox[\linewidth]{%
\begin{tabular}{| *{10}{c|} }
<your table here>
\end{tabular}%
}
\caption{<caption>}
\end{table}
For more details and options, see My table doesn't fit; what are my options?
You can try the following:
\begin{center}
\begin{tabular}{ | c | c | c | }
\hline
symbol & value & unit \\ \hline
$z Na$ & 11 & - \\ \hline
$z F$ & 9 & - \\ \hline
$Emax Na$ & 0.545 & $[MeV]$ \\ \hline
\end{tabular}
\end{center}
Refer: How to center table in latex