0

I searched a lot but unable to find the appropriate results I used the tickz library as well but it is incompatible with the IEEE access template so drop the idea.

I want to separate the section by using the double line. Reset of other column is working fine using ||l because in the second section (after space) it is needed. In the first half of the table, i don't want a double line in the second column but in the second section, I need a double line for the second column.

Note: I am posting first time. pls let me know if need further explanation.

Please find the attached picture for better understanding.

\begin{table*}[ht]

\centering \begin{tabular}{|l|l|l|l||l|l||l|l||l|l|}

\toprule \multicolumn{4}{l}{\textbf{xxxx}} &\multicolumn{2}{l}{\textbf{xxxxx}} & \multicolumn{2}{l}{\textbf{xxx}} & \multicolumn{2}{l}{\textbf{xxx}}\ \hline \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} \ \hline

&

& & & } & & & \ & & & & & & & & \ & & & & & & & & \ & & & & & && \ & & & & & & \ & & & & & & & & \ & & & & & & & & \ & & & & && & & \ \hline \multicolumn{2}{l}{\textbf{xxxx & \multicolumn{2}{l}{\textbf{xxx}} & \multicolumn{2}{l}{\textbf{xxx}} & \multicolumn{2}{l}{\textbf{xxxx }} & \multicolumn{2}{l}{\textbf{xxxx}} \ \hline

\textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{ Date } & \textbf{Year} & \textbf{ Date } & \textbf{Year} & \textbf{ Date } & \textbf{Year} & \textbf{ Date } \\hline & & & & & & & dataset\cite{ISCXVPN2016} & & \ & & & & & & & & & \ & & & & & & & & \ & & & & & & & & & \ [2pt]
\bottomrule

\end{tabular} \end{table*}

F. Pantigny
  • 40,250
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 19 '22 at 15:58
  • Added the picture for better clarity – Mubashir Hasan Jul 19 '22 at 16:00
  • 2
    Could you clear that up a bit: (1) remove the excessive whitespace that's making your code so wide, (2) include the rest of the MWE so that we can copy and paste to see what you see, (3) fix the unbalanced { and }. Also, \toprule and \bottomrule suggest that you're using booktabs, which explicitly does not work with vertical lines. It might also help to include some data, so that we can understand why you want to have 5 sets of year/date columns next to each other. – Teepeemm Jul 19 '22 at 16:09

1 Answers1

1

Welcome to TeX.SX! Once you clean up your code, it will be much easier to identify what causes your problems, not only for you, but also for others who may want to help you.

A few remarks:

  • Don't mix \toprule and \bottomrule provided by the booktabs package with \hline and vertical borders. Stick to \hline if you want to use vertical borders between columns. The booktabs package does not work well with vertical lines in tables. Also, remove [2pt] from the end of the last row.
  • Properly close all the curly brackets and use the correct amount of tab stops (&) in each row in order to make your code clear and understandable for others, for yourself and also for TeX. If you omit tab stops, some vertical lines between the cells might not be printed properly.
  • You may use spaces in the argument of tabular where you provide the column defintion. It should be easer to grasp then, where to place the vertical bars (|).

Having said that, from your question I understand that you wish to get something like the following:

\documentclass{article}

\begin{document} \begin{table}[ht] \centering \begin{tabular}{ |l|l| |l|l| |l|l| |l|l| |l|l| } \hline \multicolumn{4}{l}{\textbf{xxxx}} & \multicolumn{2}{l}{\textbf{xxxxx}} & \multicolumn{2}{l}{\textbf{xxx}} & \multicolumn{2}{l}{\textbf{xxx}} \ \hline \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} \ \hline & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ \hline \multicolumn{2}{l}{\textbf{xxxx}} & \multicolumn{2}{l}{\textbf{xxx}} & \multicolumn{2}{l}{\textbf{xxx}} & \multicolumn{2}{l}{\textbf{xxxx}} & \multicolumn{2}{l}{\textbf{xxxx}} \ \hline \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} \ \hline & & & & & & & dataset\cite{ISCXVPN2016} & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ \hline \end{tabular} \end{table}

\end{document}

enter image description here

Edit:

If the double vertical border should only appear in certain rows, you can use the \multicolumn macro to individually style the relevant cells:

\documentclass{article}

\begin{document} \begin{table}[ht] \centering \begin{tabular}{ |l|l|l|l| |l|l| |l|l| |l|l| } \hline \multicolumn{4}{l}{\textbf{xxxx}} & \multicolumn{2}{l}{\textbf{xxxxx}} & \multicolumn{2}{l}{\textbf{xxx}} & \multicolumn{2}{l}{\textbf{xxx}} \ \hline \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} \ \hline & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ & & & & & & & & & \ \hline \multicolumn{2}{l}{\textbf{xxxx}} & \multicolumn{2}{l}{\textbf{xxx}} & \multicolumn{2}{l}{\textbf{xxx}} & \multicolumn{2}{l}{\textbf{xxxx}} & \multicolumn{2}{l}{\textbf{xxxx}} \ \hline \textbf{Year} & \multicolumn{1}{l||}{\textbf{Date}} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} & \textbf{Year} & \textbf{Date} \ \hline & \multicolumn{1}{l||}{} & & & & & & dataset\cite{ISCXVPN2016} & & \ & \multicolumn{1}{l||}{} & & & & & & & & \ & \multicolumn{1}{l||}{} & & & & & & & & \ & \multicolumn{1}{l||}{} & & & & & & & & \ \hline \end{tabular} \end{table}

\end{document}

enter image description here

However, I would probably rather consider using two stacked tables.

  • Thank you for for cleaning it and provided effective advise i am definitely going to implement it in my current project. However i am not looking for this output. Attaching the picture in the provided link what i am looking for: https://drive.google.com/file/d/1nsv2_ty8sajYmUDSSZRmdRqZJ1EoGy7k/view?usp=sharing – Mubashir Hasan Jul 20 '22 at 09:04
  • Wouldn't it be better then to just use two tabulars, one above and one below? You could override the column definition l|| using \multicolumn{1}{l|}{\textbf{Date}} in the relevant cells. – Jasper Habicht Jul 20 '22 at 09:08
  • Instead of a specific cell i need till end (5 rows in totlal) after year and date. I need to separate field (xxxx). The first xxxx required 4 columns in total, rest of other required only 2 (year and dataset) – Mubashir Hasan Jul 20 '22 at 09:15
  • Yes, see my edit. But there is no simple way to change the style of the vertical rows halfways. – Jasper Habicht Jul 20 '22 at 09:19
  • Exactly what i am looking. Thanks alot for the help. I appreciate for the answer as well for the description and advise, which definitely help me in future. :) – Mubashir Hasan Jul 20 '22 at 09:22
  • For other ideas as to how to change the column style in the middle of the table, see: https://tex.stackexchange.com/q/338242/47927 – Jasper Habicht Jul 20 '22 at 09:24
  • Thanks for the sharing this. Even your idea of stacked tables is also new for me thanks :) – Mubashir Hasan Jul 20 '22 at 10:37