1

I have been using LaTex for nearly two months and have never really felt comfortable with tables. I've made them work with brute force in the past, but that is not a good long term strategy. I don't just want to make them work, I want to understand them.

Pictured below is the table I'd like to create. enter image description here

I have stumbled around with tabular and tabularx but recently found a post which suggested tabularray. I have been reading the documentation for the tabularray package as it seems to address many of the issues with other table environments/packages. Namely, the multitude of table packages leads to complications in code, difficulty in maintenance, and often package-to-package conflicts. The url to the tabularray documentation is: https://mirror.las.iastate.edu/tex-archive/macros/latex/contrib/tabularray/tabularray.pdf

I can post code for my failed attempt if that would be useful.

What am I looking for? I want to be able to begin a table environment, specify global parameters that affect the whole table (overall dimensions, cell widths\heights, vert./horiz. justification, etc.), and then specify exceptions to the global parameters on a column/row basis or perhaps even a cell basis. That makes the most sense to me and tabularray seems to the most elegant way to achieve this on its face. Would someone help me understand how to make the above table in tabularray (or provide pointers for another package/environment)? Am I even asking the correct question? I know this is probably child's play for a LaTex pro. Again, if this is easier to talk about I would love to jump in a discord call.

Thank you!

Noah

6
  • 2
    Tables can be hard to do in LaTeX. The tabularray documentation is a fantastic resource. Oct 17, 2023 at 2:59
  • 3
    Welcome! Please don't post links to specific mirrors. Links should point to the CTAN round robin for appropriate redirection to the best mirror. It isn't a great idea for someone half a world away to use the mirror closest to you. And yes, please post the code you've got. It should be minimal but complete i.e. begin \documentclass and end \end{document}. Please also specify what you mean by 'fail'. Does it give an error? Which? Does it not look as you want? How does it differ?
    – cfr
    Oct 17, 2023 at 3:12
  • 1
    Devote about two hours: Run the examples in the manual. Tweak them. The items are \begin{tblr}[overall options]{column and row options} data \end{tblr}. Options cascade:.
    – Cicada
    Oct 17, 2023 at 4:38
  • 1
    Hello @cfr. Thank you for your quick responses. I want to apologize for my late thanks; that was very rude. Your comments are duly noted for the next time I ask a question (I need to figure out how to post code on the forum too). Perhaps more specificity on my part is in order.
    – Noah
    Nov 7, 2023 at 19:00
  • Ditto to you @Cicada!
    – Noah
    Nov 7, 2023 at 19:01

1 Answer 1

4
  • Welcome to TeX.SE!
  • you should provide MWE (Minimal Working Example), a small but complete document (see @cfr comment).
  • This site is not service "we-do-your-task-instead-of-you", so there is high probability that next time your question will closed as "Needs details or clarity".
  • You should make yourself more familiar with tabularray by reading its documentation. It is concise and thoroughly explain, how to use this package
  • Since you are novice here ... for starting point try the following:
\documentclass{article}
\usepackage{lipsum}                         % for dummy text filler
\usepackage{tabularray}

\begin{document}

%\noindent                                  % it is unclear how table is inserted in text
\begin{tblr}{colspec = {X[l]X[2,l]},        % <--- specification of column style,
                                            % width of the second is twice of the first
             hlines, vlines,                % lines in table
             row{1}   = {font=\bfseries},   % column headers are in bold
             row{2-Z} = {22mm}              % height of the rest of rows
                }
Property        & Definition    \\          % column headers
\lipsum[1][1]   &   \\
text            &   \\
text            &   \\
\end{tblr}

\end{document}

enter image description here

5
  • +1 Nice example. I know, you know, just for the OP: To introduce „global parameters“ one could, e.g., move the row parameters into \newcommands or similar.
    – MS-SPO
    Oct 17, 2023 at 8:04
  • 1
    @MS-SPO, thank you very much!
    – Zarko
    Oct 17, 2023 at 8:56
  • Hello @Zarko! Thank you for your quick and informative response. I want to apologize for my belated thanks; that was very rude on my part. It amazes me that there are knowledgeable strangers on the internet willing to teach other complete strangers. As an educator and lifelong learner I appreciate your help. In particular I appreciate your code comments, neatness, and simplicity (some programmers can just info dump alternative solutions that, although correct, can ring hard in the ears of a beginner. I will try to ask more specific questions next time and provide an example (and be attentive).
    – Noah
    Nov 7, 2023 at 18:55
  • @Noah, you are welcome. However, if my answer help you and you liked it, you may consider to accept it (by clicking on check mark at the top left side of answer),
    – Zarko
    Nov 7, 2023 at 19:00
  • @Zarko Roger that! Still learning forum etiquette...
    – Noah
    Nov 8, 2023 at 1:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .