Graphics, Figures & TablesBorder missing from Table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
upani1982
Posts: 43
Joined: Wed May 12, 2010 11:42 am

Border missing from Table

Post by upani1982 »

Hi All,

I am trying to construct a table with border. But my border is missing for the first column and also the top row are looking disjointed. The code follows:

Code: Select all

\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \begin{tabular}{|r|r|r|r|r|r|}
    \addlinespace
    \toprule
    Exchange Name & 2006  & 2007  & 2008  & 2009  & 2010 \\
    \midrule
    \multicolumn{1}{c}{\multirow{2}[0]{*}{BCEXL}} & 0.28  & 0.57  & 0.20  & 0.55  & 0.55 \\
    \multicolumn{1}{c}{} & (0.01) & (0.01) & (0.00) & (0.01) & (0.01) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{BCEXM}} & 0.03  & 0.02  & 0.07  & 0.06  & 0.55 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.01) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{BOAOEX}} & 0     & 166.6 & 0     & 0     & 0 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{CICEXG}} & 0.26  & 0.27  & 0.00  & 0.04  & 0.03 \\
    \multicolumn{1}{c}{} & (0.01) & (0.01) & (0.00) & (0.00) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{COCH}} & 9.17  & 17.39 & 8.83  & 8.83  & 6.69 \\
    \multicolumn{1}{c}{} & (0.28) & (0.44) & (0.17) & (0.12) & (0.06) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{ESIM}} & 0.01  & 0.00  & 0.00  & 0.00  & 0.00 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{FCEXIL}} & 0.48  & 0.19  & 0.19  & 0.07  & 0.12 \\
    \multicolumn{1}{c}{} & (0.01) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{HCLHI}} & 0.39  & 1.55  & 0.55  & 0.41  & 0.13 \\
    \multicolumn{1}{c}{} & (0.01) & (0.04) & (0.01) & (0.01) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{IPSTAK}} & 0.05  & 0.28  & 0.52  & 0.25  & 0.42 \\
    \multicolumn{1}{c}{} & (0.00) & (0.01) & (0.01) & (0.00) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{MCX}} & 2093.65 & 3086.17 & 4512.44 & 6339.10 & 9255.07 \\
    \multicolumn{1}{c}{} & (63.53) & (78.05) & (88.29) & (84.82) & (86.64) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{NBOTI}} & 72.03 & 95.31 & 34.33 & 60.45 & 47.30 \\
    \multicolumn{1}{c}{} & (2.19) & (2.41) & (0.67) & (0.81) & (0.44) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{NCDEX}} & 1002.18 & 706.13 & 494.15 & 875.70 & 1226.18 \\
    \multicolumn{1}{c}{} & (30.41) & (17.86) & (9.67) & (11.72) & (11.48) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{NMCEIL}} & 100.60 & 22.58 & 43.45 & 171.85 & 134.52 \\
    \multicolumn{1}{c}{} & (3.05) & (0.57) & (0.85) & (2.30) & (1.26) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{ROAOED}} & 0.88  & 1.32  & 0.68  & 0.51  & 0.42 \\
    \multicolumn{1}{c}{} & (0.03) & (0.03) & (0.01) & (0.01) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{RSOBMA}} & 3.46  & 6.24  & 6.66  & 5.73  & 5.45 \\
    \multicolumn{1}{c}{} & (0.10) & (0.16) & (0.13) & (0.08) & (0.05) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{SCOAOAL}} & 3.35  & 3.71  & 2.31  & 4.18  & 4.28 \\
    \multicolumn{1}{c}{} & (0.10) & (0.09) & (0.05) & (0.06) & (0.04) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{TACEXL}} & 6.60  & 10.60 & 5.98  & 5.98  & 0.00 \\
    \multicolumn{1}{c}{} & (0.20) & (0.27) & (0.12) & (0.08) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{TEIJAHEL}} & 0.07  & 0.00  & 0.00  & 0.00  & 0.00 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{TMACEL}} & 0.25  & 0.14  & 0.20  & 0.12  & 56.8 \\
    \multicolumn{1}{c}{} & (0.01) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[0]{*}{TSOELS}} & 0.11  & 0.13  & 0.00  & 0.00  & 0.00 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \hline
    \multicolumn{1}{c}{\multirow{2}[1]{*}{VBCL}} & 1.92  & 1.13  & 0.21  & 0.01  & 0.00 \\
    \multicolumn{1}{c}{} & (0.06) & (0.03) & (0.00) & (0.00) & (0.00) \\
    \bottomrule
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%
% Table generated by Excel2LaTeX from sheet 'table'
\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \begin{tabular}{rccccc}
    \addlinespace
    \toprule
    Exchange Name & 2006  & 2007  & 2008  & 2009  & 2010 \\
    \midrule
    \multicolumn{1}{c}{\multirow{2}[2]{*}{BCEXL}} & 0.28  & 0.57  & 0.20  & 0.55  & 0.55 \\
    \multicolumn{1}{c}{} & (0.01) & (0.01) & (0.00) & (0.01) & (0.01) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{BCEXM}} & 0.03  & 0.02  & 0.07  & 0.06  & 0.55 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.01) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{BOAOEX}} & 0     & 166.6 & 0     & 0     & 0 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{CICEXG}} & 0.26  & 0.27  & 0.00  & 0.04  & 0.03 \\
    \multicolumn{1}{c}{} & (0.01) & (0.01) & (0.00) & (0.00) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{COCH}} & 9.17  & 17.39 & 8.83  & 8.83  & 6.69 \\
    \multicolumn{1}{c}{} & (0.28) & (0.44) & (0.17) & (0.12) & (0.06) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{ESIM}} & 0.01  & 0.00  & 0.00  & 0.00  & 0.00 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{FCEXIL}} & 0.48  & 0.19  & 0.19  & 0.07  & 0.12 \\
    \multicolumn{1}{c}{} & (0.01) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{HCLHI}} & 0.39  & 1.55  & 0.55  & 0.41  & 0.13 \\
    \multicolumn{1}{c}{} & (0.01) & (0.04) & (0.01) & (0.01) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{IPSTAK}} & 0.05  & 0.28  & 0.52  & 0.25  & 0.42 \\
    \multicolumn{1}{c}{} & (0.00) & (0.01) & (0.01) & (0.00) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{MCX}} & 2093.65 & 3086.17 & 4512.44 & 6339.10 & 9255.07 \\
    \multicolumn{1}{c}{} & (63.53) & (78.05) & (88.29) & (84.82) & (86.64) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{NBOTI}} & 72.03 & 95.31 & 34.33 & 60.45 & 47.30 \\
    \multicolumn{1}{c}{} & (2.19) & (2.41) & (0.67) & (0.81) & (0.44) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{NCDEX}} & 1002.18 & 706.13 & 494.15 & 875.70 & 1226.18 \\
    \multicolumn{1}{c}{} & (30.41) & (17.86) & (9.67) & (11.72) & (11.48) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{NMCEIL}} & 100.60 & 22.58 & 43.45 & 171.85 & 134.52 \\
    \multicolumn{1}{c}{} & (3.05) & (0.57) & (0.85) & (2.30) & (1.26) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{ROAOED}} & 0.88  & 1.32  & 0.68  & 0.51  & 0.42 \\
    \multicolumn{1}{c}{} & (0.03) & (0.03) & (0.01) & (0.01) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{RSOBMA}} & 3.46  & 6.24  & 6.66  & 5.73  & 5.45 \\
    \multicolumn{1}{c}{} & (0.10) & (0.16) & (0.13) & (0.08) & (0.05) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{SCOAOAL}} & 3.35  & 3.71  & 2.31  & 4.18  & 4.28 \\
    \multicolumn{1}{c}{} & (0.10) & (0.09) & (0.05) & (0.06) & (0.04) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{TACEXL}} & 6.60  & 10.60 & 5.98  & 5.98  & 0.00 \\
    \multicolumn{1}{c}{} & (0.20) & (0.27) & (0.12) & (0.08) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{TEIJAHEL}} & 0.07  & 0.00  & 0.00  & 0.00  & 0.00 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{TMACEL}} & 0.25  & 0.14  & 0.20  & 0.12  & 56.8 \\
    \multicolumn{1}{c}{} & (0.01) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{TSOELS}} & 0.11  & 0.13  & 0.00  & 0.00  & 0.00 \\
    \multicolumn{1}{c}{} & (0.00) & (0.00) & (0.00) & (0.00) & (0.00) \\
    \multicolumn{1}{c}{\multirow{2}[2]{*}{VBCL}} & 1.92  & 1.13  & 0.21  & 0.01  & 0.00 \\
    \multicolumn{1}{c}{} & (0.06) & (0.03) & (0.00) & (0.00) & (0.00) \\
    \bottomrule
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%
Please help me. This is beyond my cup of tea.

With regards,
Upananda

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Border missing from Table

Post by Stefan Kottwitz »

Hi Upananda,

the border is missing because you use \multicolumn{1}{c} which means just centered formatting without border. You could change it to

Code: Select all

\multicolumn{1}{|c}{...}
I wonder why you don't simply use c in the header and omit \multicolumn for single cells then.

Regarding the vertical lines: booktabs strongly recommends to avoid vertical lines, and I agree. They make reading harder. Just have a look at good tables in good books, they often use horizontal lines but no vertical lines, supporting reading line by line. That's a contrast to Excel-made tables which are often made as grids.

If you need vertical lines and don't want the gaps, don't use booktabs' rule commands but take \hline. Such as

Code: Select all

\begin{tabular}{|c|r|r|r|r|r|}
  \addlinespace
  \hline
  Exchange Name & 2006  & 2007  & 2008  & 2009  & 2010 \\
  \hline
  \multirow{2}[0]{*}{BCEXL} & 0.28  & 0.57  & 0.20  & 0.55  & 0.55 \\
    & (0.01) & (0.01) & (0.00) & (0.01) & (0.01) \\
  \hline
  \multirow{2}[0]{*}{BCEXM} & 0.03  & 0.02  & 0.07  & 0.06  & 0.55 \\
    & (0.00) & (0.00) & (0.00) & (0.00) & (0.01) \\
  ...
If you make it this way and need more spacing, this could be done.

Stefan
LaTeX.org admin
upani1982
Posts: 43
Joined: Wed May 12, 2010 11:42 am

Re: Border missing from Table

Post by upani1982 »

Hi Stefan,

Thanks a lot for your suggestion. I have changed my table accordingly. Is there any book authored by you. I would like to order an copy if it is available in the market.
Is that book for a novice like me.

With sincere regards,
Upananda
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Border missing from Table

Post by Stefan Kottwitz »

Hi Upananda,

yes, I've written a LaTeX book for novices: LaTeX Beginner's Guide

The link goes to the website of the publisher Packt. There you can find a sample chapter for download. This chapter is specifically about tables, such as your question. It starts with simple tables and goes to complex ones like this:
Table example
Table example
table.png (33.4 KiB) Viewed 4278 times
The first chapters are easier of course, this is chapter 5, starting at page 121. If you like the sample chapter, perhaps you like the book. You also find it on Amazon of course, for example on this website theres a picture of the book with a link to Amazon.

Stefan
LaTeX.org admin
upani1982
Posts: 43
Joined: Wed May 12, 2010 11:42 am

Re: Border missing from Table

Post by upani1982 »

Hello Sir,

Thanks a lot for your information. I am fortunate to get all these information from such a experienced person like you.

I will order the book and will read the whole book.

With sincere regards,
Upananda
Post Reply