I am trying make this table. My code
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{diagbox}
\usepackage{siunitx}
\usepackage{ninecolors}
\begin{document}
\begin{table}[htbp]
\centering
\begin{tblr}{
colspec={|c|c|},row{1}={olive9},
} \hline \text { Interval } & \text { Frequency } \\
\hline $ \left[a_1 ; a_2\right) $ & $ n_1 $ \\
{$ \left[a_2 ; a_3\right) $} & $ n_2 $ \\
$ \ldots $ & $ \ldots $ \\
{$ \left[a_m ; a_{m+1}\right) $} & $ n_m $ \\
\hline & $ n $ \\
\hline
\end{tblr}
\caption{}
\end{table}
\end{document}
In each row of the table, I use $$. How can I use a short key, e.g \newcolumntype{C}{>{$\displaystyle}c<{$}} to all mathmode of the table to remove all $$ in rows?


hline{1,2,Y,Z} = {solid}and how can I usedmath? – John Paul Peter Jan 26 '23 at 13:13hline{1,2,Y,Z} = {solid}will automatically insert horizontal lines for the first two and last two rows so you don't need all the\hlinesin the code. You can use dmath as incells={mode=dmath}(but for your example I doubt this will make much difference) – samcarter_is_at_topanswers.xyz Jan 26 '23 at 13:14row{1}={mode=text}so you don't need the\text{...}in your first row – samcarter_is_at_topanswers.xyz Jan 26 '23 at 13:26