Graphics, Figures & Tablesabout dcolumn

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
clement
Posts: 15
Joined: Wed Oct 14, 2009 5:06 am

about dcolumn

Post by clement »

hi:

I meet a problem about using dcolumn package.
I hope to create a table and its format like following:

------------------------------------------------
R G
--------------------------------------------------
kk c d e f g
--------------------------------------------------
first 1 2 3 4 5
....
---------------------------------------------------
second 5 7
....
....
---------------------------------------------------

the number of columns are different for row first and second.
row first has six and row second has three.
when I use the following commands:

Code: Select all

....
\newcolumntype{d}[1]{D{.}{\cdot}{#1}}
\newcolumntype{.}{D{.}{.}{-1}}
....
\begin{tabular}
[c]{.....}
...
\end{tabular}
...
the row second will not be align and the length of row first
will exceed the page. how to solve the problem, any suggestion
is highly appreciated, thanks a lot

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: about dcolumn

Post by localghost »

Build a complete example.


Best regards
Thorsten
clement
Posts: 15
Joined: Wed Oct 14, 2009 5:06 am

about dcolumn

Post by clement »

as following:

Code: Select all

\documentclass[12pt,letter]{article}
\usepackage{dcolumn}
\usepackage{caption}
\usepackage{booktabs}
\newcolumntype{d}[1]{D{.}{\cdot}{#1}}
\newcolumntype{.}{D{.}{.}{-1}}

\begin{document}
\begin{table}
\caption{test1}
\begin{tabular}{l........}
\toprule & \multicolumn{2}{c}{A} &  & \multicolumn{2}{c}{B} &  &
\multicolumn{2}{c}{C}\\
\midrule rows & aaaaa & bbbbb &  & ccccc & ddddd &  & eee &
fffff\\
\midrule TESTA &23.111 & 11.111** &
  & 111 & 0.111** &
  & 0.111& 11.111**\\
TESTB & 111 & 0.111 &  &
0.1110 & 11.111** &   &
11.111 & 0.111\\

\midrule TTA & \multicolumn{2}{c}{555} &  & \multicolumn{2}{c}{555} &  &
\multicolumn{2}{c}{555}\\
TTB & \multicolumn{2}{c}{555} &  & \multicolumn{2}{c}{555} &  &
\multicolumn{2}{c}{555}\\
TTC & \multicolumn{2}{c}{0.111} &  & \multicolumn{2}{c}{0.111} &  &
\multicolumn{2}{.}{0.111}\\
\bottomrule
\end{tabular}
\end{table}
\end{document}

thanks.
clement
Posts: 15
Joined: Wed Oct 14, 2009 5:06 am

Re: about dcolumn

Post by clement »

I have solved the problem, thanks.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

about dcolumn

Post by localghost »

clement wrote:I have solved the problem, thanks.
Congratulations! And it would be very kind if you post your solution.
Post Reply