1

When I use the tabularx package to generate a table, this happens:

\documentclass[aic]{iosart2x}

\usepackage{tabularx,ragged2e,booktabs,caption}
\newcommand{\heading}[1]{\bfseries\begin{tabular}{@{}c@{}} #1\end{tabular}}
\newcolumntype{C}{>{\Centering\arraybackslash}X} % 
\newcommand\mc[1]{\multicolumn{1}{C}{#1}} % handy shortcut macro 


\begin{document}
\begin{table*}[ht]
    \centering
    \footnotesize
    \begin{tabularx}{\textwidth}{|l|*{3}{C|} }
        \hline
    Number & Criterion  & Description  \\ \hline
    1 & The study is written in
    English.&There are some studies written in languages other than English, but
    because of providing an English title or abstract, they show up in
    our query result. Only studies written in English will be included for
    reasons of feasibility.\\ \hline
    2 & The study is peer
    reviewed. & To ensure a satisfying quality of primary studies, only peer-reviewed
    studies will be chosen, as they have been published by a professional
    scholarly society.\\ \hline
    3 & The model has been implemented. & To measure reliability and validity of each model, we do not consider the trust models that have not been implemented or tested before. \\\hline
    \label{tab:inc}
    \caption{Inclusion criteria}
    \end{tabularx}
    \end{table*}
\end{document}

How do I get rid of the extra vertical lines on the left side of the table?

  • Welcome. Please add a full minimal working example with \documentclass{ and \end{document}. – Bobyandbob Apr 5 '18 at 13:47
  • @Bobyandbob thank you, I added to the example. – AH2012 Apr 5 '18 at 13:51
  • 2
    Use \end{tabularx}\label{tab:inc}\caption{Inclusion criteria} \end{table*} instead of \label{tab:inc}\caption{Inclusion criteria}\end{tabularx}\end{table*} – Bobyandbob Apr 5 '18 at 13:58
  • 2
    @Bobyandbob The label must go after the caption – egreg Apr 5 '18 at 21:33
  • 1
    you are using table* for a table spanning two columns but using [ht] which is the same as [t] as you can not have a h table spanning columns. that makes it very likely to go to the end of the document as you are not allowing teh table to go on to a float page. – David Carlisle Apr 5 '18 at 22:24
3

mostly off-topic:

  • your problem with the caption is solved in the comments
  • you define four columns table, but use only three
  • according to my taste, the table is more beautiful if the text is left aligned and at align is used \raggedright instead of \RaggedRight
  • the table will be prettier if the second column is narrower than the third one

enter image description here

\documentclass[twocolumn]{article}
\usepackage{caption}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X} %
\newcolumntype{L}{>{\raggedright\arraybackslash}X} %
\newcommand\mc[1]{\multicolumn{1}{C}{#1}} 

\begin{document}
\begin{table*}[ht]
    \centering
%    \footnotesize
    \renewcommand\arraystretch{1.2}
    \begin{tabularx}{\linewidth}{ |c|>{\hsize=0.25\hsize}L|
                                     >{\hsize=0.75\hsize}L| }
        \hline
    Num. & Criterion  & Description  \\
        \hline
    1 & The study is written in English.
        &   There are some studies written in languages other than English, but
    because of providing an English title or abstract, they show up in
    our query result. Only studies written in English will be included for
    reasons of feasibility. \\
        \hline
    2 & The study is peer reviewed.
        &   To ensure a satisfying quality of primary studies, only peer-reviewed
    studies will be chosen, as they have been published by a professional
    scholarly society.\\ \hline
    3 & The model has been implemented.
        &   To measure reliability and validity of each model, we do not consider the trust models that have not been implemented or tested before. \\
        \hline
    \end{tabularx}
    \caption{Inclusion criteria}
    \label{tab:inc}
 \end{table*}
 \end{document}
  • @egreg, thank you very much for correction of the code. i overlooked this detail. – Zarko Apr 5 '18 at 21:43
  • 1
    @Mico, thank you very much. done. at copying of code i lost its end ... – Zarko Apr 6 '18 at 6:00
2

I suggest you keep using a tabularx environment, but that you use left-align rather than center the columns. I would further like to suggest that you give the table a much more open "look", by getting rid of all vertical lines and by using fewer but well-spaced horizontal lines.

In the following example, only the third column is of (modified) type X; the first and second are of type l.

enter image description here

\documentclass[twocolumn]{article} % I don't have 'iosart2x.cls'
\usepackage{tabularx,booktabs,ragged2e,caption}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\captionsetup{skip=0.333\baselineskip} % less distance between table and caption

\begin{document}
\begin{table*}
\small % "\footnotesize" not necessarry
    \begin{tabularx}{\textwidth}{@{} l lL @{}}
    \toprule
    Nr. & Criterion  & Description  \\ 
    \midrule
    1 & The study is written in English.
    &There are some studies written in languages other than English, and if
    they provide an English title or abstract, they show up in our query result. 
    For reasons of feasibility, only studies written in English will be included.\\ 
    \addlinespace
    2 & The study is peer-reviewed. 
    & To ensure satisfactory quality of primary studies, only peer-reviewed
    studies will be chosen, as they have been published by a professional
    scholarly society.\\ 
    \addlinespace
    3 & The model has been implemented. 
    & To measure reliability and validity of each model, we do not consider 
    trust models which have not been implemented or tested before.\\
    \bottomrule
    \end{tabularx}
\caption{Inclusion criteria}
\label{tab:inc}
\end{table*}
\end{document}

Addendum. The approach taken above, which uses the l column type for the second column, is OK if the sentences in the second column are short. If they were longer, it would be a good idea to allow line breaks. This could be done by using the L column type for both columns 2 and 3, with the width of the 3rd column set to be about three times that of the 2nd column.

enter image description here

\documentclass[twocolumn]{article} % I don't have 'iosart2x.cls'
\usepackage{tabularx,booktabs,ragged2e,caption}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\captionsetup{skip=0.333\baselineskip} % less distance between table and caption

\begin{document}
\begin{table*}
\small % "\footnotesize" not necessarry
    \begin{tabularx}{\textwidth}{@{} l
         % rel. widths of columns 2 and 3 add up to "2".
         >{\hsize=0.55\hsize}L 
         >{\hsize=1.45\hsize}L @{}}
    \toprule
    Nr. & Criterion  & Description  \\ 
    \midrule
    1 & The study is written in English.
    &There are some studies written in languages other than English, and if
    they provide an English title or abstract, they show up in our query result. 
    For reasons of feasibility, only studies written in English will be included.\\ 
    \addlinespace
    2 & The study is peer-reviewed. 
    & To ensure satisfactory quality of primary studies, only peer-reviewed
    studies will be chosen, as they have been published by a professional
    scholarly society.\\ 
    \addlinespace
    3 & The model has been implemented. 
    & To measure reliability and validity of each model, we do not consider 
    trust models which have not been implemented or tested before.\\
    \bottomrule
    \end{tabularx}
\caption{Inclusion criteria}
\label{tab:inc}
\end{table*}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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