4

Since colors are used in row / columns I have omitted vertical/ horizontal lines \documentclass{article} \usepackage{nicematrix} \begin{table} \setlength{\belowcaptionskip}{1ex} \centering \caption{\texttt{Table}} \label{label1} \begin{NiceTabular}{lcc}[code-before = \rowcolor{gray}{1} \columncolor{gray} {1}\cellcolor{white}{...


2

Considered only problems with (the first) table(s). After extracting relevant part of your document example, the table can be write as: %\documentclass{SPSR2} %\documentclass{pnastwo} \documentclass[twocolumn]{article} \usepackage[margin=20mm]{geometry} \usepackage{textcomp, bm} \usepackage{array, booktabs, makecell, multirow, tabularx} \newcolumntype{L}{&...


2

You can also draw that table with {NiceTabular} of nicematrix with two advantages: Instead of \multirow, you have a command \Block; with that command (which may be used to merge cells vertically but also horizontally), you have to specify the number of rows (and the number of columns) whereas, with \multirow, you have to specify the number of physical lines ...


2

A similar example with the excellent nicematrix package \documentclass{article} \usepackage{nicematrix} \usepackage{makecell} \begin{document} \begin{NiceTabular}{wC{5mm}cccc}[hvlines-except-corners] & \;\diagbox{A}{B} & \makecell{C \\ D} & \makecell{ E \\ F} & \makecell{ G \\ longer} \\ \Block{4-1}{H1} & I & text 1 & &...


2

Like This: \documentclass{article} \usepackage{slashbox} \usepackage{multirow} \begin{document} \begin{table}[] \begin{tabular}{|c|c|c|c|c|c|} \hline \multicolumn{2}{|c|}{\multirow{2}{*}{\backslashbox{B}{9}}} & \multicolumn{2}{c|}{J} & \multicolumn{2}{c|}{M} \\ \cline{3-6} \multicolumn{2}{|c|}{} &...


2

With standard tabular and xcolor package: \documentclass{article} \usepackage[table]{xcolor} \begin{document} \begin{table}[ht] \centering \begin{tabular}{|>{\columncolor{darkgray}}c|c|c|} \cline{2-3} \rowcolor{darkgray} \multicolumn{1}{c}{\cellcolor{white}} & \color{white}{\textbf{A}} ...


2

It is not clear what is your problem, Probably you looking for something like this: \documentclass{article} \usepackage{lipsum} % for text filler \usepackage{multirow, tabularx} \begin{document} \begingroup \flushleft \renewcommand\multirowsetup{} \def\arraystretch{1.5} \begin{tabularx}{\textwidth}{c l l X} A1 & A2 & A3 ...


2

The use of \multicolumn{3}{l}{} overwrites the vertical lines resulting in the small gap you see. Add the line back in using \multicolumn{3}{l|}{}. \documentclass{scrarticle} \usepackage{multirow} \begin{document} \begin{tabular}{|l|c|c|c|c|c|} \hline \multirow{3}{*}{No} & \multirow{3}{2.4cm}{Code} & \...


1

Here are two versions of your table. As you can see, I had to reduce the font size very drastically to somehow squeeze the table into a single column. You hopefully agree that the version that spans both columns looks considerably better: \documentclass[a4paper,conference]{IEEEtran} \IEEEoverridecommandlockouts \usepackage{cite} \usepackage{amsmath,amssymb,...


1

I suggest one of the two following redesigns. With this approach, your table fits onto a single page: \documentclass{article} \usepackage{xltabular} \usepackage[column=0]{cellspace} \setlength{\cellspacetoplimit}{3pt} \setlength{\cellspacebottomlimit}{\cellspacetoplimit} \addparagraphcolumntypes{X} \usepackage{booktabs} \usepackage{enumitem} \newlist{...


1

The following changes your table in the following ways: use only the available \linewidth remove \multirow (it's useless in this example as the contents won't stay on the same page most likely and the alignment doesn't work automatically anyway for p-type columns) use \raggedright in the cells with much content (for that the array package is loaded and the ...


1

A bit simplified code for a standard tabular: \documentclass[11pt]{article}% \usepackage[table, svgnames]{xcolor} \usepackage{array} \makeatletter \g@addto@macro{\endtabular}{\rowfont{}}% Clear row font \makeatother \newcommand{\rowfonttype}{}% Current row font \newcommand{\rowfont}[1]{% Set current row font \gdef\rowfonttype{#1}#1\ignorespaces% } \...


1

From your description, I guess you are interested in the t option to top align the contents of the \multirow: \multirow[t]{3}... in combination with = instead of * to make sure the width if the multirow cell adapts to the width of the column it is used inside of instead of adapting to the width of its contents: \multirow[t]{3}{=}... Combined into a MWE, ...


1

You can easily make that table with {NiceTabular} of nicematrix. The key hvlines draws all the rules excepted in the blocks (created by \Block). \documentclass{article} \usepackage{nicematrix} \NiceMatrixOptions{cell-space-bottom-limit=3pt,cell-space-top-limit=3pt} \begin{document} \begin{table} \begin{NiceTabular}{lcc}[hvlines] \Block{1-2}{\textbf{Item}} ...


1

In order to make sure a horizontal line does not cross a \multirow cell, you can use \cline instead of \hline. Specify which columns your line should appear in. Additionally, I have added the cellspace package in order to allow for a small vertical white space above and below of the text in each cell. In the third example, I also included a table using no ...


1

You can use the \cline command to draw horizontal line in only two cells. As the code is shown below: \documentclass{article} \usepackage{multirow} \begin{document} \begin{table} \begin{tabular}{|c|c|c|} \hline \multicolumn{2}{|c|}{\textbf{Item}} & \textbf{CPU33} \\ \hline \multicolumn{2}{|c|}{...


1

I have edited this answer because, since version 5.5 (2020-10-20), one must no longer write \omit\CodeAfter here (now, \CodeAfter works in all circonstancies). I you really want to add vertical rules compatible with the horizontal rules of booktabs (which is not at all in the spirit of booktabs) you should try {NiceTabular} of nicematrix. That environment ...


1

You can do that table very easily with the package nicematrix. In the environment {NiceTabular}, you can merge cells both horizontally and vertically with the built-in command \Block. Then, you have a key hvlines which will draw all the rules excepted in the blocks. \documentclass{article} \usepackage{nicematrix} \begin{document} \begin{NiceTabular}{llll}[...


Only top voted, non community-wiki answers of a minimum length are eligible