0

I want to create a Excel 2016 look-alike table using tabular. It has to show the upper left corner where you see A, B, C etc.

The result does not have to contain the "cool stuff": the triangle or shaded rules. I'd appreciate if even the basics were right.

enter image description here

My attempt fails to align the text vertically and change the column width:

enter image description here

\documentclass{standalone}
%\usepackage{fontspec}
%\newfontfamily\Calibri{Calibri.ttf}
\usepackage{colortbl}
\definecolor{excelGray}{RGB}{230,230,230}
\definecolor{excelLineGray}{RGB}{212,212,212}

\begin{document}

%\Calibri{
%\renewcommand{\arraystretch}{.8} % EDIT: commented this out
\begin{tabular}{>{\columncolor{excelGray}}c!{\color{excelLineGray}\vrule}c!{\color{excelLineGray}\vrule}c!{\color{excelLineGray}\vrule}c!{\color{excelLineGray}\vrule}}
\rowcolor{excelGray}
& A & B & C\\
\arrayrulecolor{excelLineGray}\hline
1 & 2 & 3,2\\
\arrayrulecolor{excelLineGray}\hline
2 & 4 & 4,2\\
\arrayrulecolor{excelLineGray}\hline
\end{tabular}
%}

\end{document}
  • the \renewcommand{\arraystretch}{.8} is the main culprit, why the rules touch the tops of the digits, it should never be set less than 1 try 1.1 or leave it as 1 and use \setlength\extrarowheight{2pt} – David Carlisle Mar 15 '16 at 18:34
  • Edited and commented it out. – Mappi Mar 15 '16 at 18:39
  • 3
    see package pas-tableur ctan.org/pkg/pas-tableur – touhami Mar 15 '16 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.