答案1
像这样:
\documentclass{article}
\usepackage{multicol}
\usepackage{colortbl}
\usepackage{xcolor}
\begin{document}
\begin{tabular}{|l|l|l|l|l|l|}
\hline
\rowcolor{blue!20}Utente & \multicolumn{2}{l|}{Parte pubblica} & \multicolumn{3}{l|}{Parte segreta}\\\hline
Aldo & N & e &p,q [N=p*q] & b = $\Phi$(N) & d\\\hline
Esempio& 55 & 3 & 5, 11 [55= 5*11] & 40 = $\Phi$(55) & 227\\\hline
\end{tabular}
\end{document}
答案2
尝试一下这个:
\documentclass{book}
\usepackage{xcolor,colortbl}
\begin{document}
\begin{tabular}{|l|l|l|l|l|l|}
\hline
\rowcolor{blue!10}
Utente &\multicolumn{2}{l|}{Parte pubblica} &\multicolumn{3}{c|}{Parte
segreta}\\
\hline
\color{blue}Aldo &N &e &p, q &b=Q &d\\
\hline
Esem &55 &3 &5, 11 &40 &27\\
\hline
\end{tabular}
\end{document}
答案3
除了其他答案之外,您还可以使用表格生成器。它提供了源代码,您只需将其复制到剪贴板。
答案4
一个解决方案tabularx
,使得第 2 列和第 3 列具有相同的宽度:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{tabularx}
\usepackage{xparse}
\def\myheadfont{\itshape\bfseries}
\NewExpandableDocumentCommand{\myhead}{O{1}m}{\multicolumn{#1}{c|}{\myheadfont#2}}
\usepackage[table, svgnames, x11names]{xcolor}
\begin{document}
\sffamily\renewcommand{\arraystretch}{1.4}
\centering\begin{tabularx}{0.88\textwidth}{|l|X|X|*{3}{l|}}
\hline
\rowcolor{LightSlateGray!35!Lavender}\myheadfont{Utente} & \myhead[2]{Parte pubblica} & \myhead[3]{Parte segreta} \\\hline
\rowcolor{Lavender!15}Aldo & N & e & p,q [N=p*q] & b = $\Phi$(N) & d \\\hline
\rowcolor{Lavender!15}Esempio & 55 & 3 & 5, 11 [55= 5*11] & 40 = $\Phi$(55) & 227 \\\hline
\end{tabularx}
\end{document}