Same image on same table, one is centered the other not - latex

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}

Related

How to top align a table in a table LaTeX

so i started working with latex and i'm trying to fit a table with statistical content into another table for better alignment.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx,dashrule}
\usepackage{tabularx}
\usepackage{xcolor}
\usepackage[a4paper,left=2cm,right=2cm,top=1cm,bottom=1cm]{geometry}
% Document metadata
\title{Statistische Auswertung}
\author{Automatisch Generiert}
\date{2023-02-09 16:24:04}
\begin{document}
% Dokumententitel und Datum generieren
\maketitle
\begin{tabularx}{\textwidth}{|X|X|}
{\begin{tabularx}{\linewidth}{|X|X|}
\hline
age & --- \\
count & 343.0 \\
mean & 60.8 \\
std & 12.1 \\
min & 28.0 \\
25\% & 53.0 \\
50\% & 60.0 \\
75\% & 70.0 \\
max & 89.0 \\
\hline
\end{tabularx}} & \frame{\includegraphics[width=\linewidth]{age.png}} \\
\hline
{\begin{tabularx}{\linewidth}{|X|X|}
\hline
status-fu & --- \\
count & 356 \\
unique & 2 \\
top & False \\
freq & 297 \\
\hline
\end{tabularx}} & \frame{\includegraphics[width=\linewidth]{status_fu.png}} \\
\hline
\end{tabularx}
\end{document}
The Output lools like this:
I want the Sub-tables on the left to be center top aligned with the Images on the right.
Any help???
Cheers!

LaTeX orders table before text even if in the code the table is after text. Why?

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 want to draw an up arrow on the right side of an array with a text on both the sides of arrow

I have written the following Latex code to get an array as an output:
The code:
\begin{center}
\[
\begin{array}{c|c|c}
\textbf{Base} & \textbf{Quotient} & \textbf{Remainder}\\
\hline
2 & 23 & 1\\
\hline
2 & 11 & 1\\
\hline
2 & 5 & 1\\
\hline
2 & 2 & 0\\
\hline
2 & 1 & 1\\
\hline
& 0 & \\
\end{array}
\]
\end{center}
The output obtained is shown in the below image:
I want to add an up arrow on the right side of this table with LSB at top of arrow and MSB at bottom of arrow which is shown in the following image.
Can anyone help me to do this?

Latex Table Syntax

\begin{center}
\begin{table}[h!]
\centering
\begin{tabular}{|l|l|l|l|}
\hline
Name of the Dataset File & Number of Cases & Number of Records & Primary Key \\
\hline
Detail Interaction & 147,004 & 2400 & Interaction ID \\
\hline
Detail Incident & \\
\hline
Detail Change & \\
\hline
Detail Activity & \\
\hline
\end{tabular}
\caption{Dataset description of the four datasets provided by Rabobank Group ICT.}
\end{table}
\end{center}
The table doesnt fit to the page. Can someone help me in making it in a page. The table has 4 columns and 5 rows.
I'd suggest writing the table in a more elegant way using booktabs, as there seems to be some superfluous information the headers:
\documentclass{article}
\usepackage{booktabs,siunitx}
\begin{document}
\noindent
\begin{tabular}{ l r r l }
\toprule
Dataset Filename & \multicolumn{1}{c}{Cases} & \multicolumn{1}{c}{Records} & Primary Key \\
\midrule
Detail Interaction & \num{147004} & \num{2400} & InteractionID \\
Detail Incident & \num{12345} & \num{20000} & IncidentID \\
Detail Change & \num{12} & \num{412} & ChangeID \\
Detail Activity & \num{7890} & \num{1234567} & ActivityID \\
\bottomrule
\end{tabular}
\end{document}
First of all, your code is missing some &s, in lines 11, 13 and 15: try
\begin{table}[h!]
\centering
\begin{tabular}{|l|l|l|l|}
\hline
Name of the Dataset File & Number of Cases & Number of Records & Primary Key \\
\hline
Detail Interaction & 147,004 & 2400 & Interaction ID \\
\hline
Detail Incident & & & \\% 2 occurrences of & added here
\hline
Detail Change & & & \\% 2 occurrences of & added here
\hline
Detail Activity & & & \\% 2 occurrences of & added here
\hline
\end{tabular}
\caption{Dataset description of the four datasets provided by Rabobank Group ICT.}
\end{table}
In a second instance, I advise you to see if you prefer something like
\begin{tabular}{|p{.3\textwidth}|p{.2\textwidth}|p{.2\textwidth}|p{.2\textwidth}|}
instead of just
\begin{tabular}{|l|l|l|l|}
In this case, you can use \par to get a linebreak inside a cell (for example: Name of the\par Dataset File).

How to rotate table-headline in Latex table

is there a way to rotate the "Demo 1", "Demo2" and "Demo 3" headlines 90° in the following LaText table?
\documentclass[a4paper,twoside,10pt]{report}
\begin{document}
\begin{tabular}{|l|l|l|l|}
\hline
& Demo1 & Demo2 & Demo3 \\
\hline
Person 1 & x & & \\
\hline
Person 2 & x & & x \\
\hline
Person 3 & x & x & \\
\hline
Person 4 & & x & x \\
\hline
\end{tabular}
\end{document}
Thanks
Yes. As Dr. Andrew J. Page wrote on his blog,
Put this at the top of your code:
\usepackage{rotating}
Simply to create a table with rotated column text use this code:
\begin{tabular}{|r|r|}\hline
\begin{sideways}Paper\end{sideways} &\begin{sideways}Static\end{sideways} \\
\hline
HAR1994j & Journal \\
SWRT1996c & Conference \\
\hline
\end{tabular}

Resources