Hot answers tagged

10

this adds a ; which is like : but different. \documentclass{article} \usepackage{hhline,colortbl} \makeatletter \AtBeginDocument{% \def\HH@loop{% \ifx\@tempb`\def\next##1{\the\toks@\cr}\else\let\next\HH@let \ifx\@tempb|\if@tempswa \ifx\CT@drsc@\relax \HH@add{\hskip\doublerulesep}% \else \HH@add{{\CT@drsc@\vrule\...


8

it is not strange when your table is wider than text width. make your table narrower or text width wider. in the both cases you should redefined columns headers. as are in your mwe (minimal working example) are at are very unusual defined, consequently it doesn't work as you expected. i suggest the following changes (in code indicated with comments) in ...


6

The probelm comes from a\hhline which mixes simple and doublerule. A solution consists in making two simple \hhmines with a vertical space in-between: \documentclass{article} \usepackage{hhline} \begin{document} \begin{tabular}{|c||p{2.5cm}|} \hhline{~|-} \multicolumn{1}{c|}{}& {\textbf{JANUARY}} \\[0.75ex] \hhline{~|-}\noalign{\vspace*{\doublerulesep}...


6

as samcarter commented \documentclass[xcolor=table]{beamer} \usepackage{makecell, multirow} \renewcommand\theadfont{\normalsize\bfseries\color{white}} \renewcommand{\theadgape}{} \usepackage{hhline} \makeatletter \let\zz\reset@color \def\reset@color{\kern\z@\zz} \makeatother \begin{document} \begin{frame} \frametitle{test} \centering \setlength\...


4

off-topic but can be helpful :-): your table is unnecessary complicated ... basic problem is solved by AboAmmar answer, however i suggest you don't use dashed lines in tables at all in preamble you have some packages loaded twice and also three-times xcolor supersede color. it is sufficient to load only xcolor package subfigure is obsolete. rather use ...


4

Here is how to do it with hhline: \documentclass[a4paper, twocolumn]{article} \usepackage[utf8]{inputenc} \usepackage{geometry} \usepackage{adjustbox} \usepackage[table]{xcolor} \usepackage{array, multirow, hhline, booktabs} \definecolor{blue1}{HTML}{CDDAED} \definecolor{blue2}{HTML}{DAE8FC} \definecolor{mauve}{HTML}{E1D5E7} \definecolor{violet}{HTML}{...


4

The problem is that also \justify needs \arraybackslash. But you can better do the other way around: define justification for the cells and override it for the headers. \documentclass[a4paper,11pt]{report} \usepackage[T1]{fontenc} \usepackage[english,francais]{babel} \usepackage[textwidth=16cm]{geometry} \usepackage{ragged2e} \usepackage[array,table]{xcolor}...


4

You can center align the column by inserting a \multicolumn command. Changing the format specifier to table-format=8.6 resolves the problem with the hline lenght: MWE: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{siunitx} \title{Test} \date{August 2018} \begin{document} \maketitle \section{Introduction} \begin{tabular}{rS[table-...


4

You need to change your used command \hhline{-|-|-|-|-|-|-|} to \hhline{|~|-|-|-|-|-|-|} (see the ~ at the first position marking there should be no line). So the following MWE \documentclass{article} \usepackage{hhline} \usepackage[table]{xcolor} \usepackage{array} \usepackage{multirow} \definecolor{babyblue}{rgb}{0.54, 0.81, 0.94} \definecolor{...


4

i would redesign your table as follows: \documentclass{article} \usepackage{siunitx} \usepackage[table]{xcolor} \definecolor{babyblue}{rgb}{0.54, 0.81, 0.94} \definecolor{aliceblue}{rgb}{0.94, 0.97, 1.0} \usepackage{booktabs, multirow} \newcommand\mcc[1]{\multicolumn{2}{c}{#1}} \begin{document} \begin{table}[htb] \centering \renewcommand\arraystretch{...


4

I have two MWEs: the last one cure both problems, the first does not cure the small green spaces. Using hhline You have forgotten to turn on arrayrowcolor{black} two places. In addition, the hhline- syntax was wrong one place. I have not found a solution for the small spaces in the horizontal borders (yet). It is the green coloured arrayrule under the ...


3

With table-format=8.2 you reserve space for 8 digits before the dot and 2 after the dot, you need to change it to table-format=2.8, but for your given numbers 2.6 is enough \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{siunitx} \title{Test} \date{August 2018} \begin{document} \maketitle \section{Introduction} \begin{tabular}{rS[table-...


3

As requested, but also a booktabs version. The requested version uses two tabulars that are aligned at the [b]ottom. \documentclass{article} \newlength{\rowlabelsep} \newlength{\collabelsep} \setlength{\rowlabelsep}{5pt} \setlength{\collabelsep}{5pt} \usepackage{booktabs,array} \begin{document} \begin{tabular}[b]{ | c | } \hline \bfseries Row 1 \\ ...


3

Use booktabs instead – more precisely set \above/belowrulesep to 0pt and use \midrule: \documentclass[xcolor=table]{beamer} \usepackage{makecell, multirow} \usepackage{booktabs} \renewcommand\theadfont{\normalsize\bfseries\color{white}} \renewcommand{\theadgape}{} \begin{document} \begin{frame} \frametitle{test} \centering \setlength\arrayrulewidth{...


3

You can use :: to get an open crossing instead of # however the lines are made by drawing a line in each cell, so they are separate lines which start and stop at the same point. Some PDF viewers may show a small gap due to rounding to pixel boundaries, some are better at avoiding that. It would, in principle, be possible to merge adjacent - or = segments ...


3

You can obtain what you want with a supplementary empty column and using the possibility for an \hhline to have segments with different colours. Here is a code, in which I took the liberty to replace the gray colour by a lighter shade of grey, making the contents of the coloured cells more readable: \documentclass[]{article} \usepackage[table, svgnames]{...


3

FWIW, I find that ConTeXt's table mechanisms are MUCH cleaner for creating such tables. For example, here is how to create this table using the extreme tables mechanism: \definecolor[C1][h=ffe2cc] \definecolor[C2][h=fff2cc] \definecolor[C3][h=cddaed] \definecolor[C4][h=dae8fc] \definecolor[C5][h=d4b1e5] \definecolor[C6][h=e1d5e7] \setupxtable[mytable] ...


3

I am a fan of packages that include others with improvements, in this case through the tabu package, you can vary the thickness and style of the horizontal lines with a single command \tabulinestyle{2pt black} but it will occur that spaces will appear, for that reason you must manually subtract the thickness at the end of new row command & foo \\[-barpt],...


3

The reason for the misplaced vertical lines is a conflict between the arydshln and the hhline packages. You need to get rid of arydshln if you can go without it. If you can't remove arydshln, then you may try tabu, it's a powerful all-in-one tables package which can work with hhline and has its own dash-line styles. So, in your preamble, you can use \...


3

Here is a solution for the white line in the \multirow. intead of using \hhline{~|-|-|-|-|-|-|}, I use a full width \hhline , but make the first segment coloured with the background colour of the \multirow. I also took the liberty to simplify your code, and use the AliceBlue colour from svgnames, as it doesn't seem different from your aliceblue. \...


2

lie this? what you see as rules in your table are actually gaps between cells with size of rules thicknes. they appear as rules since you have all rules in white color ... this gaps can be colored with part of rule in multirow cell: \documentclass{article} \usepackage[a4paper,margin=1in]{geometry} \usepackage[svgnames,table]{xcolor} \usepackage{makecell, ...


2

You can use the code from David Carlisle's answer https://tex.stackexchange.com/a/52042/15925 as follows \documentclass{memoir} \usepackage{supertabular} \usepackage[usenames,dvipsnames,svgnames,table]{xcolor} \usepackage{forloop} \makeatletter \let\savedST@cr\ST@cr \def\ST@cr{\noalign{\ifnum0=`}\fi\futurelet\st@temp\ST@crhline} \def\ST@crhline{% \ifx\...


2

Some weird interaction with arydshln here I just add some negative space to close the gap and add an invisible 0-width rule to lengthen the visible rules in the first row, \documentclass{article} \usepackage{color} \usepackage{url} \usepackage{graphicx} \usepackage[table]{xcolor} \usepackage{multirow} \usepackage{makecell} \usepackage{arydshln} \...


2

\documentclass[dvipsnames,12pt]{article} \usepackage{xcolor,array,ragged2e,booktabs,colortbl} \usepackage{multicol,multirow} \usepackage{hhline} \begin{document} \newcolumntype{M}[1]{>{\hspace{0pt}\Centering $}p{#1}<{$}} \renewcommand{\arraystretch}{1.5} \newcommand{\vlineTS}[1][1.2pt]{\color{gray!70}\vrule width #1} \setlength\arrayrulewidth{1....


2

like this? it is simple. instead \hline use \cline{2-5}: \begin{tabular}{ cc|ccccc } & & 0 & A & B & C & $\leftarrow$End Point\\ \cline{2-6\emph{}} & 0 & 0 & 3 & 7 & 5 \\ Start Point$\rightarrow$ & A & 3 & 0 & 2 & 9 \\ & B & 7 & 2 & 0 & 6 \\ & C & 5 & 9 &...


2

Dirty trick: \documentclass{article} \usepackage{array} \renewcommand{\arraystretch}{1.4} \newcolumntype{C}{>{\centering\arraybackslash}p{5em}} \newcommand{\mystr}{\rule{0pt}{3ex}} \begin{document} \begin{tabular}{|C|@{}p{5pt}@{}|C|C|} \cline{3-4} \multicolumn{1}{c}{} && \mystr\textbf{Col 1} & \textbf{Col 2}\\ \cline{3-4} \noalign{\...


2

In the following I use code that I wrote for an unpublished package (unpublished meaning it is not on CTAN -- and might never be). I just copied the code and made it compatible with this MWE with the least possible effort, so it might not be an optimal implementation for the stuff you want to achieve. I don't include a documentation of what is possible with ...


2

- makes a single line, you need = to get separated double line \documentclass[a4paper,11pt]{article} \usepackage{hhline} \begin{document} \begin{tabular}{c|c|} A & B \\ \hhline{~|=} C & D \\ \hhline{~|=|} \end{tabular} \end{document}


2

This was a very challenging one. I have simplified your code, removed seemingly unnecessary \multirow and \multicolumn. The reason for you problem was the ?-column, because hhline did not recognise it as a column, so it was not possible to ‘cross’ it the correct way. Here is the result and the code: \documentclass[a4paper]{article} \usepackage{multirow,...


1

i would redesign your table as follows: \documentclass{report} \usepackage{wrapfig} \usepackage{array, booktabs, multirow} \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} \usepackage[table,xcdraw]{xcolor} \definecolor{lightgray}{rgb}{0.75,0.75,0.75} \definecolor{darkgray}{rgb} {0.50,0.50,0.50} \usepackage{hhline} \newcommand\lightline{% \hhline{~...


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