0

I would like to draw the following table enter image description here Is there any other way to do that with other package

I tried Tabu but the line of cell is close to the content of it

\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{tabu}
\usepackage[table]{xcolor}
\usepackage{tabularx, multirow, makecell, rotating} %
\usepackage{enumitem}

\begin{document}
\begin{center}
\begin{tabu} spread \linewidth{|X[c]|X[4]|} \hline
Year 2023-2024 & Very long very long text Very long very long text Very long very long text  \\\hline
Year 2022-2023  & Very long very long text Very long very long text Very long very long text \\\hline
Year 2021-2022 & Very long very long text Very long very long text Very long   \\\hline
Year 2020-2021 &Very long very long text Very long very long text Very long very long text  \\\hline
Year 2019-2020 & Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text  \\\hline
Year 2018-2019 &Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text  \\\hline
\end{tabu}
  • Tabu macro\tabulinesep=foo pt sets the minimal vertical space allowed between the cell content and the cell border see the manual subsection 2.4, it is placed before the tabu environment. – J Leon V. May 6 '18 at 21:31
  • @JLeonV. Is it you that you downvote my question ? – Educ May 6 '18 at 21:46
  • Although I could simply downvote in anonymity, I gave myself the time to write because the package is specialized in this type of things, and is treated as if it did not have those controls, you are even looking for an alternative without consulting the manual, ... as it is advised not to give more important, upvotes are worth more, but downvotes are implemented to encourage users to improve. – J Leon V. May 6 '18 at 23:15
3

Here is a variant using tabularx and only one flexible width X column:

\documentclass{article}
\usepackage{tabularx} 

\begin{document}
\renewcommand{\arraystretch}{1.25}
\noindent
\begin{tabularx}{\linewidth}{|l|X|} \hline
Year 2023-2024 & Very long very long text Very long very long text Very long very long text  \\\hline
Year 2022-2023  & Very long very long text Very long very long text Very long very long text \\\hline
Year 2021-2022 & Very long very long text Very long very long text Very long   \\\hline
Year 2020-2021 &Very long very long text Very long very long text Very long very long text  \\\hline
Year 2019-2020 & Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text  \\\hline
Year 2018-2019 &Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text  \\\hline
\end{tabularx}
\end{document}
3

like this:

enter image description here

you need to increase relative width of the first column:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{rotating}
\usepackage[table]{xcolor}
\usepackage{makecell, multirow, tabu, tabularx} 
\usepackage{enumitem}

\begin{document}
    \begin{center}
    \tabulinesep=3pt
\begin{tabu}to\linewidth{|X[1.1,c]|X[3.9]|} 
    \hline
Year 2023-2024  & Very long very long text Very long very long text Very long very long text  \\
    \hline
Year 2022-2023  & Very long very long text Very long very long text Very long very long text \\
    \hline
Year 2021-2022  & Very long very long text Very long very long text Very long   \\
    \hline
Year 2020-2021  & Very long very long text Very long very long text Very long very long text  \\
    \hline
Year 2019-2020  & Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text  \\
    \hline
Year 2018-2019 &Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text Very long very long text  \\
    \hline
\end{tabu}
    \end{center}
\end{document}

or simply use the following table column definition:

\begin{tabu}to\linewidth{|c|X|} 

result is very similar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.