在 tabularx 中枚举

在 tabularx 中枚举

我正在尝试列举一个(价格)列表,但已将其放入 tabularx 环境中以使价格和说明一致。

\documentclass[a4paper,12p]{article}

\setlength{\voffset}{-1.5cm}
\setlength{\textheight}{650pt}
\setlength{\hoffset}{-1.5cm}
\setlength{\textwidth}{450pt}

\usepackage{tabularx}

\begin{document}

%\begin{enumerate}
\begin{tabularx}{\textwidth}{>{\everypar{\hangindent1cm}}p{12cm} b{2.5cm}}
\textbf{DICOM Package Plus:} including interface and software for: Storage- (incl. Storage Comm.), Worklist- (incl. MPPS), Query- and Media-Class, Twisted Pair 100 MB & \\
&  \hfill Price:    \$ 16,225 \\
\\
 \textbf{Upgrade of monitors:} High-resolution, high-brightness 19” duel flat screen monitors (1280 x 1024 pixel) on the mobile stand & \\
& \hfill Price:     \$ 8,676 \\
\end{tabularx}

% Here I want to insert 4-8 more options

%\end{enumerate}

\end{document}

我尝试过在 \tabularx 环境内部和外部使用 \enumerate,但都不起作用。(我选择了 tabularx,因此描述在某个点中断)。我可以实现具有指定宽度的编号列表吗?

答案1

不清楚您在表格中使用“枚举”是什么意思。我猜您喜欢自动编号的行并带有项目描述,如下所示:

在此处输入图片描述

\documentclass[a4paper,12p]{article}
\usepackage{geometry}
\usepackage{tabularx}
\newcommand\mce{\multicolumn{1}{c}{}}
\newcounter{RowNum}
\usepackage{siunitx}

\begin{document}
    \begin{tabular}{>{\stepcounter{RowNum}\theRowNum}c
                    >{\everypar{\hangindent1cm}}p{12cm} 
                    >{\$}S[table-format=3.3,
                           %table-align-text-pre = false,
                           table-space-text-pre = {\$\,},
                           output-decimal-marker={,},    % <---
                           table-column-width=25mm]} 
    &   \textbf{DICOM Package Plus:} including interface and software for: Storage- (incl. Storage Comm.), Worklist- (incl. MPPS), Query- and Media-Class, Twisted Pair 100 MB
        &   \mce    \\
\mce    &&   16,225  \\
    &   \textbf{Upgrade of monitors:} High-resolution, high-brightness 19” duel flat screen monitors (1280 x 1024 pixel) on the mobile stand
        &   \mce    \\
\mce    &&   8,676   \\
    \end{tabular}
\end{document}

编辑:小数点标记由 定义output-decimal-marker={,}。现在它被添加到S列参数中。

相关内容