How can I do an alignment with the =
characters for a=1
, abbbbbb=5
and csf=6
?
It should look like this but inside the table:
a=1
abbbbbb=5234
csf=6
My code is:
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{positioning}
\usepackage{flowchart}
\usetikzlibrary{arrows}
\usepackage{fix-cm}
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
\setlength{\heavyrulewidth}{1.5pt}
\setlength{\abovetopsep}{4pt}
\usepackage{amsmath}
\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{|c|c|}
\hline
\multicolumn{1}{|l|}{a } & looooooooooong \\
\hline
\multirow{3}[6]{*}{c} & a=1 \\
\cline{2-2} & abbbbbb=5234 \\
\cline{2-2} & csf = 6 \\
\hline
\end{tabular}%
\end{table}%
\end{document}
What I tried (but didn't work):
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{positioning}
\usepackage{flowchart}
\usetikzlibrary{arrows}
\usepackage{fix-cm}
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
\setlength{\heavyrulewidth}{1.5pt}
\setlength{\abovetopsep}{4pt}
\usepackage{amsmath}
\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{|c|c|}
\hline
\multicolumn{1}{|l|}{a } & looooooooooong \\
\hline
\multirow{3}[6]{*}{c} &\begin{align} a&=1 \\
\cline{2-2} & abbbbbb&=5234 \\
\cline{2-2} & csf &= 6 \end{align} \\
\hline
\end{tabular}%
\end{table}%
\end{document}
I hope someone can help me. I searched a bit in the forums but it all the solution seem to be so complicated for a quite simple problem like this. Also it's Tex so there should be a nice analytic solution I hope cause I need this feature quite often in my tables.
align
enviroment? – myname Sep 27 '17 at 22:25\multirow
) where i'll write in the first row 1=message
, in the second row 2=information
.message
andinformation
will have different widths and since it the rows will be under each other it looks bad if i don't align them. – myname Sep 27 '17 at 23:09