Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to create a table as: enter image description here

It is a complicated table both in size and style: I have tried the following code:

\documentclass{article}

\usepackage{booktabs}

\begin{document}
\begin{table}
    \begin{tabular}{|l|lll|ll|l|ll|}
    \hline
     Name   of bus stop         & Number of passengers & ~     & ~          & ~      & ~     & Growth in Bike-and-ride users (\%) & Share of bike-and-ride users & ~     \\
    ~                           & Before               & After & Growth (\%) & Before & After & ~                                 & Before                       & After \\ \hline
    Zevenbergen-Drie Hoefijzers & 28                   & 28    & 0          & 23     & 18    & -18                               & 82                           & 65    \\
    Oosterhout-Europaweg        & 32                   & 47    & 47         & 4      & 14    & 250                               & 13                           & 30    \\
    Oosterhout-Napoleonlaan     & 195                  & 211   & 8          & 10     & 17    & 90                                & 5                            & 8     \\
    Oosterhout-Elkhuizenlaan    & 127                  & 123   & -3         & 14     & 27    & 80                                & 11                           & 22    \\
    Oosterhout-Busstation       & 409                  & 647   & 58         & ~      & 220   & 35                                & 41                           & 34    \\
    Werkendam-Sleewijk          & 129                  & 184   & 43         & 92     & 127   & 32                                & 71                           & 69    \\
    Raamsdonkveer Busstation    & 448                  & ~     & ~          & ~      & ~     & ~                                 & ~                            & ~     \\
    Total                       & 1368                 & 1718  & 26         & 520    & 618   & 20                                & 38                           & 36    \\ \hline
    \end{tabular}
\end{table}
\end{document}

And as a result an unlike table is created:

enter image description here

share|improve this question
2  
Definitely a good start is to read about multicolumns and multirows for tables. –  azetina Nov 8 '13 at 22:23
1  
Also note that the any text after a % character is considered a comment and not parsed. you should replace the instances of % with the escaped version \%. –  ArTourter Nov 8 '13 at 22:30
    
@azetina, What should I do for the width of the table? –  Topdombili Nov 8 '13 at 22:47
    
Well it depends what you want to achieve? Do you want the table to use all of the text width or any specific dimensions? –  azetina Nov 8 '13 at 22:49
    
@azetina I have already assigned all the page width but the problem still exist. –  Topdombili Nov 8 '13 at 22:56

1 Answer 1

Here is a starter. Study the code. I do not guarantee that it is fully optimized as to what you want but it can help you achieve your goals:

\documentclass{article}
\usepackage{booktabs,multirow}% http://ctan.org/pkg/{booktabs,multirow}
\setlength{\parindent}{0pt}% Just for this example
\begin{document}
\makebox[\linewidth]{%
\begin{tabular}{|p{3.5cm}|l|l|l|l|l|p{2cm}|l|l|}
\hline
Name of bus stop & \multicolumn{3}{l|}{Number of Passengers} & \multicolumn{2}{p{2.5cm}|}{Number of bike-and-ride users} & Growth in Bike-and-ride users (\%) & \multicolumn{2}{p{2.5cm}|}{Share of bike-and-ride users}\\ \cline{2-6}\cline{8-9}
& Before & After & Growth (\%) & Before & After && Before & After\\ \hline
Zevenbergen-Drie Hoefijzers & 28  & 28    & 0  & 23  & 18  & -18   & 82   & 65    \\
\hline
\end{tabular}%
}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.