1

This is my table:

\documentclass{article}
\usepackage{tabularx}
\begin{document}


\noindent
\begin{tabularx}{\linewidth}{@{}|p{3.5cm}|X|X|}
some text & \multicolumn{2}{|c|}{some text} \\
\end{tabularx}

\end{document}

which renders as

table with thick lines

Is there a way to get rid of the thicker rule in the middle without removing one of the pipe symbols | in the table preamble or in the multicolumn command?

9
  • 1
    Change |c| -> c|
    – daleif
    Commented Nov 27, 2019 at 9:46
  • @daleif I have edited my question.
    – topskip
    Commented Nov 27, 2019 at 9:50
  • It is not a thick rule, it's just you have two normal rules next to each other; one induced by the first column and the other from \multicolumn{2}{|c|} (the left rule).
    – Bernard
    Commented Nov 27, 2019 at 9:57
  • @Bernard I know. Now the question is: is there a way to avoid the double rule?
    – topskip
    Commented Nov 27, 2019 at 10:00
  • 2
    except for the first column rules are only on the right so basically \multicolumn{2}{|c|} is an unreported syntax error. There are things you can do but all of them are more complicated than using \multicolumn{2}{c|} Commented Nov 27, 2019 at 10:33

2 Answers 2

1

I will give an alternative solution with tblr environment of tabularray package. Firstly, it make a correct multicolumn cell which spans two X columns. Secondly, by using \SetCell command we don't need to worry about cell borders.

\documentclass{article}
\usepackage{tabularray}
\begin{document}

\noindent
\begin{tblr}{@{}|t{3.5cm}|X|X|}
some text & \SetCell[c=2]{c} some text & \\
\end{tblr}

\end{document}

enter image description here

0

Here is an alternative with {NiceTabular} of nicematrix. In that environment, the command \Block merges cells both vertically and horizontally and the rules (for instance specified by | in the preamble) are not drawn in the blocks.

\documentclass{article}
\usepackage{nicematrix}
\begin{document}

\noindent
\begin{NiceTabular}{|p{3.5cm}|X|X|}
some text & \Block{1-2}{some text} & \\
\end{NiceTabular}

\end{document}

You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .