多行多列的表格

多行多列的表格

多行多列的表格

如何在 Latex 中创建此 Excel 表?表格输入的所有颜色均相同。

编辑:接受答案后,是否可以删除\byfield包中的垂直线?

\begin{center}
\begin{bytefield}{64}
\bitbox{12}{\textbf{Made Classification}} & \bitbox{8}{Water} & \bitbox{8}{Air} & \bitbox{16}{Chromium} \\

\bitbox{12}{\textbf{Classification Control}} & \bitbox{4}{NNG} & \bitbox{4}{On/off}& \bitbox{4}{NNG}& \bitbox{4}{On/off}& \bitbox{8}{NNG} & \bitbox{8}{On/off}\\

\bitbox{12}{\textbf{Compressing Interval}} & \bitbox{2}{R} & \bitbox{2}{S}& \bitbox{2}{R}&\bitbox{2}{S}& \bitbox{2}{R} & \bitbox{2}{S}& \bitbox{2}{R} & \bitbox{2} {S}& \bitbox{4}{R} & \bitbox{4}{S}& \bitbox{4}{R} & \bitbox{4}{S}\\

\bitbox{12}{\textbf{Compatibility Fan}} & \bitbox{1}{V} & \bitbox{1}{F}& \bitbox{1}{V}& \bitbox{1}{F}& \bitbox{1}{V} & \bitbox{1}{F}& \bitbox{1}{V}& \bitbox{1}{F}& \bitbox{1}{V} & \bitbox{1}{F}& \bitbox{1}{V}& \bitbox{1}{F}& \bitbox{1}{V} & \bitbox{1}{F}& \bitbox{1}{V}& \bitbox{1}{F}& \bitbox{2}{V} & \bitbox{2}{F}& \bitbox{2}{V}& \bitbox{2}{F}& \bitbox{2}{V} & \bitbox{2}{F}& \bitbox{2}{V}& \bitbox {2}{F}\\

\bitbox{12}{\textbf{Vertical Alignment}}& \bitbox{1}{1} & \bitbox{1}{2}& \bitbox{1}{3}& \bitbox{1}{4}& \bitbox{1}{} & \bitbox{1}{5}& \bitbox{1}{}& \bitbox{1}{}& \bitbox{1}{6} & \bitbox{1}{7}& \bitbox{1}{8}& \bitbox{1}{9}& \bitbox{1}{} & \bitbox{1}{10}& \bitbox{1}{}& \bitbox{1}{}& \bitbox{2}{11} & \bitbox{2}{}& \bitbox{2}{}& \bitbox{2}{}& \bitbox{2}{} & \bitbox{2}{}& \bitbox{2}{}& \bitbox {2}{}\\
\end{bytefield}
\end{center}

答案1

字节字段是制作这些物品的绝佳工具包。 字节字段表

\documentclass{memoir}
\usepackage{bytefield}
\begin{document}

\begin{bytefield}{32}

\bitbox{8}{\textbf{Type}} & \bitbox{8}{A} & \bitbox{8}{B} & \bitbox{8}{C} \\
\bitbox{8}{\textbf{Alignment}} & \bitbox{4}{1} & \bitbox{4}{2}& \bitbox{4}{1} 
& \bitbox{4}{2}& \bitbox{4}{1} & \bitbox{4}{2}\\
\bitbox{8}{\textbf{Visual}} & \bitbox{2}{PO} & \bitbox{2}{RO}& \bitbox{2}{PO} 
& \bitbox{2}{RO}& \bitbox{2}{PO} & \bitbox{2}{RO}& \bitbox{2}{PO} & \bitbox{2}
{RO}& \bitbox{2}{PO} & \bitbox{2}{RO}& \bitbox{2}{PO} & \bitbox{2}{RO}\\
\bitbox{8}{\textbf{Capacity}} & \bitbox{1}{Q} & \bitbox{1}{W}& \bitbox{1}{E}& 
\bitbox{1}{R}& \bitbox{1}{Q} & \bitbox{1}{W}& \bitbox{1}{E}& \bitbox{1}{R}& \b
itbox{1}{Q} & \bitbox{1}{W}& \bitbox{1}{E}& \bitbox{1}{R}& \bitbox{1}{Q} & \bi
tbox{1}{W}& \bitbox{1}{E}& \bitbox{1}{R}& \bitbox{1}{Q} & \bitbox{1}{W}& \bitb
ox{1}{E}& \bitbox{1}{R}& \bitbox{1}{Q} & \bitbox{1}{W}& \bitbox{1}{E}& \bitbox
{1}{R}\\
\end{bytefield}

\end{document}

答案2

这是宽表的简短代码。由于其内容重复,我使用了循环\xintFor(来自xinttools包)。

\documentclass[a4paper,french, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}% Gère l'indentation de la première ligne
\usepackage{tcolorbox}
\usepackage{lipsum}
\tcbset{before upper={\parindent=1.5em}}

\begin{document}
\subsubsection*{Simple \LaTeX}
\lipsum[2]
Voici un texte.

Avec un paragraphe.
\subsubsection*{Dans une tcolorbox}
\begin{tcolorbox}
  \lipsum[2]
  Voici un texte.

  Avec un paragraphe.
\end{tcolorbox}

\subsubsection*{Dans une minipage}
\begin{minipage}{\textwidth}\setlength{\parindent}{2em}
  \lipsum[2]
  Voici un texte.

  Avec un paragraphe.
\end{minipage}

\end{document}

在此处输入图片描述

相关内容