tables add tag
Laurenso
I am trying to make a longtable with `tabularray` package. This is my code

```
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{diagbox}
\UseTblrLibrary{varwidth}
\UseTblrLibrary{booktabs}
\usepackage{enumitem}
\usepackage{ninecolors}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{xurl}
\sisetup{output-decimal-marker={,}}
\UseTblrLibrary{siunitx} 
\usepackage{tikz,tkz-tab}
\usepackage[paperwidth=20.5cm, paperheight=29cm, left=1.7cm,right=1.7cm,top=1.8cm,bottom=1.7cm]{geometry}

\begin{document}

\begin{table}[htbp]
	\centering
	\begin{longtblr}{
			colspec = {Q[2.5cm,c]X[l]Q[2cm,l]},
			vlines,
			hlines,
			row{1}={yellow9},
			vlines,
			hline{1,2,Y,Z} = {solid}
		}
		Problem & Content & Point \\
\SetCell[r=4]{t}	\textbf{Problem 1} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
	\SetCell[r=4]{b}	\textbf{Problem 2} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
	\SetCell[r=4]{b}	\textbf{Problem 3} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
	
	\SetCell[r=4]{b}	\textbf{Problem 4} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
	\SetCell[r=4]{}	\textbf{Problem 5} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
	\SetCell[r=4]{b}	\textbf{Problem 6} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		\SetCell[r=4]{b} Problem 7 & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
	\SetCell[r=4]{b}	\textbf{Problem 8} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
		\SetCell[r=4]{b}	\textbf{Problem 9} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
		\SetCell[r=4]{b}	\textbf{Problem 10} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
		\SetCell[r=4]{b}	\textbf{Problem 11} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
	\end{longtblr} 
	\caption{} 
\end{table}
\end{document}
```
I do not get all table. My questions:
1. How can I get all longtable?
2. How can I set cell at row 1 and column 2 is center?


![image.png](/image?hash=52398b16047d3c5fd34d8b637d89353d258c3ff68612443716aa7d509a963470)
Top Answer
samcarter
A `longtblr` is a bit different than normal tables, like the `booktabs` environment you used in your previous question.

As the `longtblr` is able to break across pages, it should not be enclosed in a `table` environment. Instead you place it at the position at which you want it to appear in your document. The caption can be passed with `caption={...}` as an optional argument to the `longtblr` environment.

To centre the second cell of the first row, you can use `cell{1}{2}={halign=c}`.


```
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{diagbox}
\UseTblrLibrary{varwidth}
\UseTblrLibrary{booktabs}
\usepackage{enumitem}
\usepackage{ninecolors}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{xurl}
\sisetup{output-decimal-marker={,}}
\UseTblrLibrary{siunitx} 
\usepackage{tikz,tkz-tab}
\usepackage[paperwidth=20.5cm, paperheight=29cm, left=1.7cm,right=1.7cm,top=1.8cm,bottom=1.7cm]{geometry}

\begin{document}

	\begin{longtblr}[
      caption={some text for the caption}
  ]{
			colspec = {Q[2.5cm,c]X[l]Q[2cm,l]},
			vlines,
			hlines,
			row{1}={yellow9},
			vlines,
			hline{1,2,Y,Z} = {solid},
      cell{1}{2}={halign=c},
		}
		Problem & Content & Point \\
\SetCell[r=4]{t}	\textbf{Problem 1} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
	\SetCell[r=4]{b}	\textbf{Problem 2} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
	\SetCell[r=4]{b}	\textbf{Problem 3} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
	
	\SetCell[r=4]{b}	\textbf{Problem 4} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
	\SetCell[r=4]{}	\textbf{Problem 5} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
	\SetCell[r=4]{b}	\textbf{Problem 6} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		\SetCell[r=4]{b} Problem 7 & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
	\SetCell[r=4]{b}	\textbf{Problem 8} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
		\SetCell[r=4]{b}	\textbf{Problem 9} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
		\SetCell[r=4]{b}	\textbf{Problem 10} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
		
		\SetCell[r=4]{b}	\textbf{Problem 11} & Solve the equation $ x^2 - 5x + 6 = 0 $ &  \textbf{1 point}  \\
		& $ \Delta =(-5)^2 - 4 \cdot 1 \cdot 6 = 1$. & \num{0,25} \\
		& $ x = \dfrac{-(-5) -1}{2} = 2$, and  $ x = \dfrac{-(-5)  + 1}{2} = 3$. & \num{0,5} \\
		& The given equation has two solutions $x=2$ and $x = 3$. & \num{0,25} \\
	\end{longtblr} 

\end{document}
```

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.