add tag
JohnPaul
I want to align content in the diagbox environment. This is my code
```
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{diagbox}
\UseTblrLibrary{varwidth}
\usepackage{float}
\usepackage{enumitem}
\usepackage{ninecolors}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{xurl}
\sisetup{output-decimal-marker={,}}
\UseTblrLibrary{siunitx} 
\usepackage[paperwidth=20.5cm, paperheight=29cm, left=1.7cm,right=1.7cm,top=1.8cm,bottom=1.7cm]{geometry}
\begin{document}
	
\begin{table}[H]
\centering
\begin{tblr}{
  colspec={*{10}{c}},
  row{1}={olive9,mode=text},
  vlines,hlines,
  hline{1,2,Z}={solid},
  cells={mode=dmath}
}
\diagbox{\begin{varwidth}{2.8cm} \centering Trigonometric values  \end{varwidth}}{\text{Angle } \alpha}  
  & 0^\circ & 30^\circ & 45^\circ & 60^\circ & 90^\circ & 120^\circ & 135^\circ & 150^\circ & 180^\circ \\

\sin\alpha 
  & 0 & \dfrac{1}{2} & \dfrac{\sqrt{2}}{2} & \dfrac{\sqrt{3}}{2} & 1 
  & \dfrac{\sqrt{3}}{2} & \dfrac{\sqrt{2}}{2} & \dfrac{1}{2} & 0 \\

\cos\alpha 
  & 1 & \dfrac{\sqrt{3}}{2} & \dfrac{\sqrt{2}}{2} & \dfrac{1}{2} & 0 
  & -\dfrac{1}{2} & -\dfrac{\sqrt{2}}{2} & -\dfrac{\sqrt{3}}{2} & -1 \\

\tan\alpha 
  & 0 & \dfrac{\sqrt{3}}{3} & 1 & \sqrt{3} & || 
  & -\sqrt{3} & -1 & -\dfrac{\sqrt{3}}{3} & 0 \\

\cot\alpha 
  & || & \sqrt{3} & 1 & \dfrac{\sqrt{3}}{3} & 0 
  & -\dfrac{\sqrt{3}}{3} & -1 & -\sqrt{3} & || \\
\end{tblr}
\end{table} 
\end{document}

```

![image.png](/image?hash=3b2b87223be1c987022977cade40134730f74bc303e3e90680abd8f156057b05)

![image.png](/image?hash=6f1eb0035b99f0de621aea43257f0123961c2357b00facd571c976e5cd02c8ec)

In this figure, the diagonal passes through the dot of the letter i and very close to the letter C. How can I avoid this?
Top Answer
samcarter
As a quick and dirty hack, you could manually add a line break:

```
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{diagbox}
\UseTblrLibrary{varwidth}
\usepackage{float}
\usepackage{enumitem}
\usepackage{ninecolors}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{xurl}
\sisetup{output-decimal-marker={,}}
\UseTblrLibrary{siunitx} 
\usepackage[paperwidth=20.5cm, paperheight=29cm, left=1.7cm,right=1.7cm,top=1.8cm,bottom=1.7cm]{geometry}
\begin{document}
	
\begin{table}[H]
\centering
\begin{tblr}{
  colspec={*{10}{c}},
  row{1}={olive9,mode=text},
  vlines,hlines,
  hline{1,2,Z}={solid},
  cells={mode=dmath}
}
\diagbox{\begin{varwidth}{2.8cm} \centering Trigono-\\ metric values  \end{varwidth}}{\text{Angle } \alpha}  
  & 0^\circ & 30^\circ & 45^\circ & 60^\circ & 90^\circ & 120^\circ & 135^\circ & 150^\circ & 180^\circ \\

\sin\alpha 
  & 0 & \dfrac{1}{2} & \dfrac{\sqrt{2}}{2} & \dfrac{\sqrt{3}}{2} & 1 
  & \dfrac{\sqrt{3}}{2} & \dfrac{\sqrt{2}}{2} & \dfrac{1}{2} & 0 \\

\cos\alpha 
  & 1 & \dfrac{\sqrt{3}}{2} & \dfrac{\sqrt{2}}{2} & \dfrac{1}{2} & 0 
  & -\dfrac{1}{2} & -\dfrac{\sqrt{2}}{2} & -\dfrac{\sqrt{3}}{2} & -1 \\

\tan\alpha 
  & 0 & \dfrac{\sqrt{3}}{3} & 1 & \sqrt{3} & || 
  & -\sqrt{3} & -1 & -\dfrac{\sqrt{3}}{3} & 0 \\

\cot\alpha 
  & || & \sqrt{3} & 1 & \dfrac{\sqrt{3}}{3} & 0 
  & -\dfrac{\sqrt{3}}{3} & -1 & -\sqrt{3} & || \\
\end{tblr}
\end{table} 
\end{document}
```

For more control, you could use tikz:

```
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{diagbox}
\UseTblrLibrary{varwidth}
\UseTblrLibrary{tikz}
\usepackage{float}
\usepackage{enumitem}
\usepackage{ninecolors}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{xurl}
\sisetup{output-decimal-marker={,}}
\UseTblrLibrary{siunitx} 
\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{tblrtikzabove}
\tikzset{inner sep=4pt}
\draw (1-1.north west) -- (1-1.south east);
\node[anchor=south west,text width=2.5cm,align=left] at (1-1.south west) {Trigono-\\ metric values }; 
\node[anchor=north east] at (1-1.north east) {Angle $\alpha$}; 
\end{tblrtikzabove}%
\begin{tblr}{
  colspec={Q[6cm]*{9}{c}},
  row{1}={olive9,mode=text,ht=1cm},
  vlines,hlines,
  hline{1,2,Z}={solid},
  cells={mode=dmath}
} 
  & 0^\circ & 30^\circ & 45^\circ & 60^\circ & 90^\circ & 120^\circ & 135^\circ & 150^\circ & 180^\circ \\

\sin\alpha 
  & 0 & \dfrac{1}{2} & \dfrac{\sqrt{2}}{2} & \dfrac{\sqrt{3}}{2} & 1 
  & \dfrac{\sqrt{3}}{2} & \dfrac{\sqrt{2}}{2} & \dfrac{1}{2} & 0 \\

\cos\alpha 
  & 1 & \dfrac{\sqrt{3}}{2} & \dfrac{\sqrt{2}}{2} & \dfrac{1}{2} & 0 
  & -\dfrac{1}{2} & -\dfrac{\sqrt{2}}{2} & -\dfrac{\sqrt{3}}{2} & -1 \\

\tan\alpha 
  & 0 & \dfrac{\sqrt{3}}{3} & 1 & \sqrt{3} & || 
  & -\sqrt{3} & -1 & -\dfrac{\sqrt{3}}{3} & 0 \\

\cot\alpha 
  & || & \sqrt{3} & 1 & \dfrac{\sqrt{3}}{3} & 0 
  & -\dfrac{\sqrt{3}}{3} & -1 & -\sqrt{3} & || \\
\end{tblr}
\end{table} 
\end{document}
```

![Screenshot 2025-08-22 at 15.01.41.png](/image?hash=3020e2e62e12dd11dfd7ac492ff1ca3abf7ea9f5484f5f0bd67abad9309a264f)

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.