\DocumentMetadata{lang=en,pdfversion=2.0,pdfstandard=ua-2,tagging=on}
\documentclass[12pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage{dcolumn}
\usepackage{booktabs}
\usepackage{fcolumn}
\usepackage{longtable} % Note that longtable is loaded after fcolumn, to demonstrate 
% that since v1.4.4 of fcolumn this is no longer a problem.
\usepackage[tableposition=top,aboveskip=0pt]{caption}
% The next lines are a fix to the caption package, as that package is incompatible with tagging.
\RemoveFromHook{begindocument}[latex-lab-testphase-float]
\makeatletter \ExplSyntaxOn
\socket_new_plug:nnn{tagsupport/parbox/before}{caption}
  {\tagpdfparaOn %restart para tagging
   \tl_if_empty:NTF\@current@float@struct{\tag_struct_begin:n{tag=Caption,firstkid}}
    {\tag_struct_begin:n{tag=Caption,parent=\@current@float@struct,firstkid}}}
\socket_new_plug:nnn{tagsupport/parbox/after}{caption}{\tag_struct_end:}
\l@addto@macro\caption@beginex@hook{\tagpdfparaOff %leavevmode in parbox should not start paragraph structure
  \AssignSocketPlug{tagsupport/parbox/before}{caption}
  \AssignSocketPlug{tagsupport/parbox/after}{caption}}
\ExplSyntaxOff 
\makeatother % End fix
\DeclareCaptionStyle{normal}{labelfont={rm,bf,small},textfont={rm,small},
 indention=0pt,labelsep=colon,justification=raggedright}
\captionsetup[table]{style=normal}
\captionsetup{singlelinecheck=false}
\usepackage{color}
\usepackage[hidelinks]{hyperref}
\def\cs#1{{\tt #1}}
\begin{document}
\noindent
Document showing all tables (except the verbatim versions) from \cs{fcolumn.pdf} 
v1.5, but now without using \cs{\char`\\documentclass\{l3doc\}}, 
i.e., in a ``normal'' \LaTeX-file.  It is using \cs{\char`\\DocumentMetadata}, 
however.  The \cs{caption} package, that is loaded as well, needed to be patched,
since without patching it is incompatible with tagging.
\floatsep=5pt plus 2pt minus 3pt
\textfloatsep=5pt plus 2pt minus 3pt
%\topfraction=0.9
%\bottomfraction=0.9
%\textfraction=0.05
\setcounter{totalnumber}{9}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}

The most basic tabular is given here.  Note that it is not balanced, so 
\cs{\char`\\checkfcolumns} will warn about that fact (see the transcript file).
\begin{table}[htb]
\begin{tabular}{@{}lflf@{}}
item 1 & 3000 & item 3 & 5000 \\
item 2 & 4000 & item 4 & 6000  \\
\sumline
\end{tabular}
\end{table}

A basic tabular (somewhat nicer due to the use of \cs{booktabs}) is given 
here as Table~\ref{tab:fcraw}.
\begin{table}[htb]
\caption{Example Table.} \label{tab:fcraw}
\begin{tabular}{@{}lflf@{}}
\multicolumn4{@{}c@{}}{\bfseries Balance sheet}\\
\toprule
properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\
\midrule
house        & 200000    & equity capital &  50000    \\
bank account &   -603,23 & mortgage       & 150000    \\
savings      &  28000                                 \\
cash         &    145,85 & profit         &  27542,62 \\
\sumline
\bottomrule
\end{tabular}
\end{table}

One of the two options to \cs{fcolumn} is `strict', that causes
negative numbers to be put between parentheses, instead of using a minus sign.
This is shown in Table~\ref{tab:strict}.
\begin{table}[htb]
\makeatletter \strict@ccountingtrue
\caption{Example Table with option `strict'.} \label{tab:strict}
\begin{tabular}{@{}lflf@{}}
\multicolumn4{@{}c@{}}{\bfseries Balance sheet}\\
\toprule
properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\
\midrule
house        & 200000    & equity capital &  50000    \\
bank account &   -603,23 & mortgage       & 150000    \\
savings      &  28000                                 \\
cash         &    145,85 & profit         &  27542,62 \\
\sumline
\bottomrule
\end{tabular}
\end{table}

Table~\ref{tab:fclong} will split to demonstrate the combined use of 
\cs{longtable} and \cs{fcolumn}. It needed some tweaking to get this
table here with splitting.
\begin{longtable}[l]{@{}lflf@{}}
\caption{Table showing compatibility of fcolumn and 
  longtable.\label{tab:fclong}}\\
\multicolumn4{@{}c@{}}{\bfseries Balance sheet}\\
\toprule
properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\
\midrule
\endfirsthead
\caption[]{\textit{(continued from previous page)\/}}\\
\toprule
properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\
\midrule
\endhead
\bottomrule
\multicolumn4{@{}r@{}}{\small\textit{(Table continues on 
  next page)\/}}\\
\endfoot
\bottomrule
\endlastfoot
house        & 200000    & equity capital &  50000    \\
bank account &   -603,23 & mortgage       & 150000    \\
savings 1    &   7000                                 \\
savings 2    &   7000                                 \\
savings 3    &   7000                                 \\
savings 4    &   7000                                 \\
cash         &    145,85 & profit         &  27542,62 \\
\sumline
\end{longtable}


The contents of Table~\ref{tab:fcoverflow} below will normally generate 
errors---that can be ignored here because that's the whole purpose of this
demonstration table.  In production runs, however, that's annoying, so a
redefinition of \cs{\char`\\PackageError} is included 
\begin{table}[!htb]
\def\PackageError#1#2#3{\PackageWarning{#1}{#2: #3}} % <-- This line
\caption{Examples on overflow.}
\label{tab:fcoverflow}
\begin{tabular}{@{}lfff@{}}
\multicolumn4{@{}c@{}}{\bfseries Projects}\\
\toprule
income & \leeg{31 dec 2014} & \leeg{31 dec 2015} & \leeg{31 dec 2016} \\
\midrule
item~1 &  20000000 & 20000000 & 20000000 \\
item~2 &  10000000 &  2000000 & -1500000 \\
item~3 &   5000000 & -1500000 &  2000000 \\
\checkfcolumns23
\sumline
\bottomrule
\end{tabular}
\end{table}
within the table environment, softening these errors into warnings.  If you 
want to see the raw errors generated by the tabular, remove (or comment) the
line redefining it.

The other option to \cs{fcolumn} is `red', that causes
negative numbers to be put in red colour, instead of using a minus sign.
This is shown in Table~\ref{tab:red}.
\begin{table}[!htb]
\makeatletter \minusr@dtrue
\caption{Example Table with option `red'.} \label{tab:red}
\begin{tabular}{@{}lflf@{}}
\multicolumn4{@{}c@{}}{\bfseries Balance sheet}\\
\toprule
properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\
\midrule
house        & 200000    & equity capital &  50000    \\
bank account &   -603,23 & mortgage       & 150000    \\
savings      &  28000                                 \\
cash         &    145,85 & profit         &  27542,62 \\
\sumline
\bottomrule
\end{tabular}
\end{table}

\newpage
Here the same contents as in Table~\ref{tab:fcraw}, but now with 
colour and font formatting changes as Table~\ref{tab:fcformat}.
\newcolumntype{q}[1]{F.,{3,2}{#1}}
\begin{table}[!htb]
\caption{Example Table with column formatting.} \label{tab:fcformat}
\begin{tabular}{@{}lq{\color{blue}\mathsf,\mathbf}lq{\color{magenta}}@{}}
\multicolumn4{@{}c@{}}{\bfseries Balance sheet}\\
\toprule
properties & \leeg{31 dec 2014} & debts & \leeg{31 dec 2014}\\
\midrule
house        & 200000    & equity capital &  50000    \\
bank account &   -603,23 & mortgage       & 150000    \\
savings      &  28000                                 \\
cash         &    145,85 & profit         &  27542,62 \\
\sumline
\bottomrule
\end{tabular}
\end{table}

And a demonstration of \cs{\char`\\resetsumline} in 
Table~\ref{tab:fcmult}. 
\begin{table}[!htb]
\caption{Example: multiple projects.} \label{tab:fcmult}
\begin{tabular}{@{}lfflff@{}}
\multicolumn6{@{}c@{}}{\bfseries Project~1}\\
\toprule
expense & \leeg{actual} & \leeg{budget} & 
income  & \leeg{actual} & \leeg{budget} \\
\midrule
food   &  450,20 & 500    & tickets & 1200    & 1000    \\
drinks &  547,5  & 400                                  \\
music  &  180    & 100                                  \\
profit &   22,3                                         \\
\sumline[2pt][10pt]
\resetsumline
\multicolumn6{@{}c@{}}{\bfseries Project~2}\\
\toprule
expense & \leeg{actual} & \leeg{budget} & 
income & \leeg{actual} & \leeg{budget} \\
\midrule
food   &  250    & 300    & tickets &  400    &  450    \\
drinks &  100    &  80                                  \\
music  &   80    &  70    & loss    &   30              \\
\sumline
\bottomrule
\end{tabular}
\end{table}

Excess digits, e.g., more than two for the default \cs{3,2} setting of \cs{\#3}
can be given.  Table~\ref{tab:fctrunc} shows how these will be dealt with, i.e.,
they are basically discarded.
\newcolumntype{d}{D,,{-1}}
\begin{table}[!htb]
\caption{Truncating excess digits.}
\label{tab:fctrunc}
\begin{tabular}{@{}ldfl@{}}
\toprule
composer & \multicolumn1c{raw entry} & \leeg{debt} & remark \\
\midrule
Berg        & 123,450  & 123,450  & silently ignoring digit ``0''             \\
Eisler      & 234,563  & 234,563  & warning: digit ``3'' ignored              \\
Sch\"onberg & 345,6704 & 345,6704 & warning: digits ``04'' ignored            \\
Webern      &   2,3456 &   2,3456 & warning: digits ``56'' ignored, i.e.,     \\
            &          &          & \quad without rounding this entry to 2,35 \\
\sumline
\bottomrule
\end{tabular}
\end{table}


Followed by a small equation to trigger some math as proof that
the math tagging still takes place.
\begin{equation}
x^n+y^n=z^n
\end{equation}
\end{document}
