I need space between rows and remove white lines between the columns. All the answers I found only referenced array stretch and \tabcolsep
, which I use and like, however, these only change the cell-padding, not the spacing.
There are little white lines everywhere. I need to get rid of the ones between the columns and make them wider between the rows.
(Also since im already here. How can i vertically center the stuff in my cells? Seems row 1 is a little weird, while the others are vcentered?
\begin{table}[h]
\centering
\caption{My caption}
\vspace{10pt}
\label{my-label}
\def\arraystretch{2}
\setlength\tabcolsep{20pt}
\begin{tabular}{ L{5cm} c c }
& \color{THIblue} {\bf something}
& \color{THIblue} {\bf anotherThing} \\
\rowcolor{THIlight}
Feature 1
& \checkmark
& \checkmark \\
\rowcolor{THIlight}
Feature 2
& \checkmark
& \checkmark \\
\rowcolor{THIlight}
Feature 3
& \checkmark
& \checkmark \\
\rowcolor{THIlight}
Feature 4
&
& \checkmark \\
\rowcolor{THIlight}
Feature 5
&
& \checkmark \\
\rowcolor{THIlight}
Feature 6
&
& \checkmark \\
\end{tabular}
\end{table}
EDIT: I defined my L Table column like this:
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
Because I wanted a left-aligned cell that is a certain size. What do I need to add to make that vertically centered?
Best Answer
Here is what I did:
cellspace
package as Bernard did because it is the simplest. You could use any other method like\newcolumntype
or\raisebox
(See this question for example), but this is easy and accurate\setlength\arrayrulewidth{1.5pt}
, besides using\arrayrulecolor{white}
to make it white instead of the default blackcss
code of the page and used it to color rows and text after defining the colors inHTML
by\definecolor{THIblue}{HTML}{C3CFF4}
or inRGB
by\definecolor{THIblue}{RGB}{195,207,244}
Finally, here is the full code
Edit:
Using a
\newcolumntype
would be more beneficial if the cell content is longer than one line. To achieve this, we define\newcolumntype{B}{>{\begin{minipage}{5cm}\raggedright\vspace{10pt}}c<{\vspace{10pt}\end{minipage}}}
instead ofcellspace
. The values5cm
and10pt
should be adjusted as needed. Take care though not to leave a cell in the first column empty. Use\phantom{Word}
to get the right calculation of cell height.