Skip to main content
\\
Source Link
David Carlisle
  • 828.7k
  • 74
  • 1.7k
  • 2.6k

I want to use a tabular to list some headlines, that might be quite long or contain linebreaks. The first column is kind of an Index or Key for the second columns content, so i would like to (vertically) center it (and i'll add \midrules for readability). To achieve the centering i included the array-package with its column definition m{2.5em}. The remaining two columns have fixed widths, too. But - as in the following MWE - the first column is somehow vertically placed top or bottom but not centered.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \begin{document} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & Lorem ipsum dolor sit amet, consectetur adipisici elit&\ elit&\\  B & \begin{minipage}[t]{.5\textwidth-6\tabcolsep-8em} An\\even\\higher\\row\\with\\linebreaks \end{minipage}&\ &\\  2 & Short Entry & \\\bottomrule \end{tabular} \end{document} 

And here's how it looks, as you can see, the first column is not vertically centered (i know in this quick MWE the minipage does not have enough space below). MWE of the non vertically centered first column

Any ideas?

I want to use a tabular to list some headlines, that might be quite long or contain linebreaks. The first column is kind of an Index or Key for the second columns content, so i would like to (vertically) center it (and i'll add \midrules for readability). To achieve the centering i included the array-package with its column definition m{2.5em}. The remaining two columns have fixed widths, too. But - as in the following MWE - the first column is somehow vertically placed top or bottom but not centered.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \begin{document} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & Lorem ipsum dolor sit amet, consectetur adipisici elit&\  B & \begin{minipage}[t]{.5\textwidth-6\tabcolsep-8em} An\\even\\higher\\row\\with\\linebreaks \end{minipage}&\  2 & Short Entry & \\\bottomrule \end{tabular} \end{document} 

And here's how it looks, as you can see, the first column is not vertically centered (i know in this quick MWE the minipage does not have enough space below). MWE of the non vertically centered first column

Any ideas?

I want to use a tabular to list some headlines, that might be quite long or contain linebreaks. The first column is kind of an Index or Key for the second columns content, so i would like to (vertically) center it (and i'll add \midrules for readability). To achieve the centering i included the array-package with its column definition m{2.5em}. The remaining two columns have fixed widths, too. But - as in the following MWE - the first column is somehow vertically placed top or bottom but not centered.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \begin{document} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & Lorem ipsum dolor sit amet, consectetur adipisici elit&\\  B & \begin{minipage}[t]{.5\textwidth-6\tabcolsep-8em} An\\even\\higher\\row\\with\\linebreaks \end{minipage}&\\  2 & Short Entry & \\\bottomrule \end{tabular} \end{document} 

And here's how it looks, as you can see, the first column is not vertically centered (i know in this quick MWE the minipage does not have enough space below). MWE of the non vertically centered first column

Any ideas?

uploaded image to imgur
Source Link
diabonas
  • 26.5k
  • 6
  • 112
  • 151

I want to use a tabular to list some headlines, that might be quite long or contain linebreaks. The first column is kind of an Index or Key for the second columns content, so i would like to (vertically) center it (and i'll add \midrules for readability). To achieve the centering i included the array-package with its column definition m{2.5em}. The remaining two columns have fixed widths, too. But - as in the following MWE - the first column is somehow vertically placed top or bottom but not centered.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \begin{document} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & Lorem ipsum dolor sit amet, consectetur adipisici elit&\ B & \begin{minipage}[t]{.5\textwidth-6\tabcolsep-8em} An\\even\\higher\\row\\with\\linebreaks \end{minipage}&\ 2 & Short Entry & \\\bottomrule \end{tabular} \end{document} 

And here's how it looks, as you can see, the first column is not vertically centered (i know in this quick MWE the minipage does not have enough space below). MWE of the non vertically centered first column http://rbergmann.info/temp/tex.se/mwe-tabular-center.pngMWE of the non vertically centered first column

Any ideas?

I want to use a tabular to list some headlines, that might be quite long or contain linebreaks. The first column is kind of an Index or Key for the second columns content, so i would like to (vertically) center it (and i'll add \midrules for readability). To achieve the centering i included the array-package with its column definition m{2.5em}. The remaining two columns have fixed widths, too. But - as in the following MWE - the first column is somehow vertically placed top or bottom but not centered.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \begin{document} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & Lorem ipsum dolor sit amet, consectetur adipisici elit&\ B & \begin{minipage}[t]{.5\textwidth-6\tabcolsep-8em} An\\even\\higher\\row\\with\\linebreaks \end{minipage}&\ 2 & Short Entry & \\\bottomrule \end{tabular} \end{document} 

And here's how it looks, as you can see, the first column is not vertically centered (i know in this quick MWE the minipage does not have enough space below). MWE of the non vertically centered first column http://rbergmann.info/temp/tex.se/mwe-tabular-center.png

Any ideas?

I want to use a tabular to list some headlines, that might be quite long or contain linebreaks. The first column is kind of an Index or Key for the second columns content, so i would like to (vertically) center it (and i'll add \midrules for readability). To achieve the centering i included the array-package with its column definition m{2.5em}. The remaining two columns have fixed widths, too. But - as in the following MWE - the first column is somehow vertically placed top or bottom but not centered.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \begin{document} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & Lorem ipsum dolor sit amet, consectetur adipisici elit&\ B & \begin{minipage}[t]{.5\textwidth-6\tabcolsep-8em} An\\even\\higher\\row\\with\\linebreaks \end{minipage}&\ 2 & Short Entry & \\\bottomrule \end{tabular} \end{document} 

And here's how it looks, as you can see, the first column is not vertically centered (i know in this quick MWE the minipage does not have enough space below). MWE of the non vertically centered first column

Any ideas?

Source Link
Ronny
  • 6.3k
  • 3
  • 34
  • 55

Centering cells of a tabular column using m{}

I want to use a tabular to list some headlines, that might be quite long or contain linebreaks. The first column is kind of an Index or Key for the second columns content, so i would like to (vertically) center it (and i'll add \midrules for readability). To achieve the centering i included the array-package with its column definition m{2.5em}. The remaining two columns have fixed widths, too. But - as in the following MWE - the first column is somehow vertically placed top or bottom but not centered.

\documentclass[a4paper,div=calc]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs,calc} \begin{document} \begin{tabular}{>{\raggedleft}m{2.5em}b{.5\textwidth-6\tabcolsep-8em}p{5.5em}}% \toprule\textbf{\#}&\textbf{Name}&\textbf{Notes}\\\midrule% A & Lorem ipsum dolor sit amet, consectetur adipisici elit&\ B & \begin{minipage}[t]{.5\textwidth-6\tabcolsep-8em} An\\even\\higher\\row\\with\\linebreaks \end{minipage}&\ 2 & Short Entry & \\\bottomrule \end{tabular} \end{document} 

And here's how it looks, as you can see, the first column is not vertically centered (i know in this quick MWE the minipage does not have enough space below). MWE of the non vertically centered first column http://rbergmann.info/temp/tex.se/mwe-tabular-center.png

Any ideas?