2

I tried

\begin{align*}
&\textbf{\small{Denomination}} \quad &\textbf{\small{Scope in weeks}} \quad &\textbf{\small{Grade}}\\
&\text{Native language, literature} &7 &3
\end{align*}

But numbers do not align properly.

What would be fastest way to produce similar table ?

table

  • 3
    align is a math display you want tabular here, with \begin{tabular}{lr;} for the three columns, – David Carlisle May 4 at 8:09
  • 1
    If your table is longer than one page, you might also want to use the longtable package. – leandriis May 4 at 8:21
  • @DavidCarlisle I get error Extra alignment tab has been changed to \cr. [&\textbf{\small{Denomination}} \quad &] – flowian May 4 at 8:51
  • 1
    @flowian: Remove the first & sign. A MWE: \documentclass{article} \begin{document} \begin{tabular}{lrl} \textbf{\small{Denomination}} &\textbf{\small{Scope in weeks}} &\textbf{\small{Grade}}\\ Native language, literature &7 &3 \end{tabular} \end{document} – leandriis May 4 at 8:57
  • 5
    also the ; in my first comment was supposed to be an l sorry. – David Carlisle May 4 at 8:58
4

an alternative option, slightly more "sophisticated":

\documentclass{article}
\usepackage{longtable,  % for case if table is longer than one page
            makecell}   % for columns headers
\renewcommand\theadfont{\normalsize\bfseries}  % column header font definition
\usepackage{siunitx}    % for S column type, numbers are aligned at decimal point

\begin{document}
\begin{center}
\begin{tabular}{lS[table-format=1.1]l}
\thead{Denomination}        & {\thead{Scope\\ in weeks}} &\thead{Grade} \\
Native language, literature & 7     & 3 (rahuldav)                      \\
some topic                  & 0.5   & 3 (rahuldav)                      \\
Microprocessor engineering  & 2.5   & 5 (viga hea)
\end{tabular}
\end{center}

in case if you need \verb+longtable+:

\begin{longtable}{lS[table-format=1.1]l}
\thead{Denomination}        & {\thead{Scope\\ in weeks}} &\thead{Grade} \\
Native language, literature & 7     & 3 (rahuldav)                      \\
some topic                  & 0.5   & 3 (rahuldav)                      \\
Microprocessor engineering  & 2.5   & 5 (viga hea)
\end{longtable}
\end{document}

enter image description here

addendum: some people prefer if the column header are vertically aligned at theirs bottoms:

enter image description here

this cab be done with use of the \thead[b]{...} instead of \thead{...} in the first tables rows in above mwe (minimal working example):

\thead[b]{Denomination} & {\thead[b]{Scope\\ in weeks}} &\thead[b]{Grade} \\
2

The following small example should give you an idea how to start:

\documentclass{article} 
\begin{document} 
\begin{tabular}{lrl} 
\textbf{\small Denomination} &\textbf{\small Scope in weeks} &\textbf{\small Grade}\\ Native language, literature &7 &3 
\end{tabular} 
\end{document}

enter image description here

If the contents in the first column are too long and the table no longer fits into the textwidth, you might want to use tabularx. If the whole table is longer than a single page, the longtable environment might be useful.

  • Please note that the font size switches don’t take an argument thus \small{text} must be {\small text} if you want to fence the effect of the change. In your example it doesn’t matter, since the table cell is a group already and the font change is only active in the cell. See also “Font switch vs. Text command” in tex.stackexchange.com/a/139592/4918. – Tobi May 4 at 22:03

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.