## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Align Equal Signs in Table Column Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
NELLLY
Posts: 113
Joined: Thu Nov 26, 2009 2:21 am

### Align Equal Signs in Table Column

Good morning,

I have the following table, after execution the signs "=" in the first column of the table are not aligned, what could I do to make them so?
\documentclass[11pt,a4paper,english]{article}\usepackage[T1]{fontenc}\usepackage[latin1]{inputenc}\usepackage{babel}\usepackage[includeheadfoot,margin=2cm]{geometry}\usepackage[font=small,labelfont=bf,tableposition=top]{caption}\usepackage{booktabs,multirow}\begin{document}\setlength{\tabcolsep}{0.8cm}\begin{table}[bth]\caption{Level planning of the input parameters} \centering\begin{tabular}{ccc}\toprule[1.2pt]\multirow{2}{*}{ Model parameter}&\multicolumn{2}{c}{Level}\\\cmidrule{2-3}&Low&High\\\midrule[1.2pt]$A=p_0$&0.03&0.08 \\$B=\delta$&0.5&1\\$C=L_0$&50&250\\$D=L_1$&500&700\\$E=\lambda$&0.001&0.008\\$F=M$&80&160\\$G=b$&0&1\\$H=c$&0.1&0.5\\  \bottomrule[1.2pt]\label{Factorlevels}\end{tabular}\end{table}\end{document}

Tags:

tom
Posts: 73
Joined: Thu Apr 18, 2013 4:02 am
Hi,

Right now, you center-align the first column. Because the content of each cell has different length, the equations are miss-aligned. You could left-align the first column which doesn't fix the problem entirely, due to the differences in letter width.

\begin{tabular}{lcc}\toprule[1.2pt]

I suggest the use of separate columns.

\documentclass[11pt,a4paper,english]{article}\usepackage[T1]{fontenc}\usepackage[latin1]{inputenc}\usepackage{babel}\usepackage[includeheadfoot,margin=2cm]{geometry}\usepackage[font=small,labelfont=bf,tableposition=top]{caption}\usepackage{booktabs,multirow, array}\begin{document}\setlength{\tabcolsep}{0.8cm}\begin{table}[bth]\caption{Level planning of the input parameters} \centering\begin{tabular}{r@{$\:$}lcc}\toprule[1.2pt]\multicolumn{2}{l}{\multirow{2}{*}{Model parameter}}&\multicolumn{2}{c}{Level}\\\cmidrule{3-4}&&Low&High\\\midrule[1.2pt]$A$&$=p_0$&0.03&0.08 \\$B$&$=\delta$&0.5&1\\$C$&$=L_0$&50&250\\$D$&$=L_1$&500&700\\$E$&$=\lambda$&0.001&0.008\\$F$&$=M$&80&160\\$G$&$=b$&0&1\\$H$&$=c$&0.1&0.5\\  \bottomrule[1.2pt]\label{Factorlevels}\end{tabular}\end{table}\end{document}

NELLLY
Posts: 113
Joined: Thu Nov 26, 2009 2:21 am
Many thanks. your proposed solution works perfectly.

Return to “Graphics, Figures & Tables”

### Who is online

Users browsing this forum: No registered users and 5 guests