您好,如何使用 latex 获得与图片相同的表格,其中包含 3 列:姓名、姓氏、职能。此表格来自 Microsoft Word。我希望使用深蓝色 :#5530FF
作为标题,使用这种颜色 :#86D3FF
作为替代行。
我希望三列的宽度相同。
这是我尝试过的:
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[hmargin=2cm,vmargin=3cm,headheight=65pt]{geometry}
\usepackage{wrapfig}
\usepackage{enumitem}
\usepackage{float}
\usepackage{eurosym}
\usepackage{tabto}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{xspace}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{biblatex}
%\addbibresource{references.bib}
\usepackage{hyperref}
\hypersetup{pdfstartview = {XYZ null null 1.00}}
\usepackage{csquotes}
\colorlet{punct}{red!60!black}
\definecolor{background}{HTML}{EEEEEE}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{numb}{magenta!60!black}
%HEADER <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,
\renewcommand{\footrulewidth}{1pt}
\renewcommand{\headrulewidth}{1pt}
\fancyhead[C]{\leftmark }
\fancyhead[L]{\includegraphics[scale=0.15]{example-image-c}}
\fancyhead[R]{\includegraphics[scale=0.2]{example-image-c}}
%\fancyfoot[C]{\thepage}
\fancyfoot[L]{blabla}
\fancyfoot[R]{\textbf{\thepage /\pageref{LastPage}}} % added <<<<<<<<<<<<<<<
\fancyfoot[C]{\fbox{Confidential}} % added <<<<<<<<<<<<<<<
\pagestyle{fancy}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\newcommand{\hsp}{\hspace{20pt}}
\begin{document}
\begin{titlepage}
\begin{sffamily}
\begin{center}
% Upper part of the page. The '~' is needed because \\
% only works if a paragraph has started.
\begin{figure}[th]
\includegraphics[width=5cm]{example-image-a}\hfill
\includegraphics[width=5cm]{example-image-b}
\end{figure}
\vspace{3cm}
% \textsc{\Large }\\[1.5cm]
% Title
\HRule \\[0.4cm]
{ \huge \bfseries blabla\\[0.4cm] }
\HRule \\[1cm]
%\includegraphics[width=12cm]{images/f5.png}
% Author and supervisor
\Large blabla\\
\Large{blabla} \\
\Large blabla\\[1cm]
\vspace{3cm}
\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{\textbf{blabla}}\\
\textsc{blabla}\\
\textsc{blabla}\\
\end{flushleft}
\end{minipage}
~
\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{\textbf{blabla}}\\
\textsc{blabla}\\
\textsc{blabla}\\
\end{flushright}
\end{minipage}
\vfill
% Bottom of the page
\vspace{1cm}
{\large 2021 - 2022}
\end{center}
\end{sffamily}
\end{titlepage}
\newpage
\section{blabka}
\begin{tabular} {|>{\columncolor{#5530FF}}c|>{\columncolor{#86D3FF}}l|>{\columncolor{#86D3FF}}r|}
\hline
name & lastname & description l\\
\hline
text & text & text \\
text & text & text \\
text & text & text \\
text & text & text \\
\hline
\end{tabular}
\vspace{-0.5cm}
\newpage
\tableofcontents
\end{document}
答案1
您的问题属于“代替我做这件事”(免费)。这不是这个网站的工作方式……
你应该提供一个 MWE,它能表明你的问题到底是什么。像这样:
\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}
\begin{table}[htb]
\begin{tblr}{hlines={blue}, vlines={blue},
colspec = {*{3}{X[l]}},
row{1} = {c, font=\bfseries, fg=white, bg=blue},
row{even} = {bg=blue!10}
}
text & text & text \\
text & text & text \\
text & text & text \\
text & text & text \\
\end{tblr}
\end{table}
\end{document}
这实际上没有任何问题 :-)。然后描述一下你在努力中遇到的困难...