I'm trying to typeset a table whose cells are divided into columns, and the columns are separated by dotted lines. This is for variable-length enumerations of (short) entries and planned to look approximately like this:
+-----------+------------------+
| A . E | H . L . P |
| B . F | I . M . |
| C . G | J . N . |
| D . | K . O . |
+-----------+------------------+
Because this table is generated from data, there are some factors that i can easily handle with the generating software, and since it is only a single table with like a hundred entries, i can manually fine-tune which table columns get one, two, or three sub-columns to optimize the appearance.
My idea is to use a minipage inside each table cell, thereby taking advantage of the fact that columns are filled in a balanced way; however, it would be perfectly acceptable to forego minipages and instead create a table with so-and-so many sub-cells and place each entry programmatically.
What I don't get working is the dotted dividers. These are intended to be dots, not dashes. Furthermore, whatever technique is used to draw them, they must get their coordinates from inside of XeLaTeX (it is conceivable to set absolute columns widths, but i'd rather avoid that; it is also conceivable to put the table at specific offset from the top of the page, but I really want to avoid that).
Also, I would love to draw each divider individually — if you just drew dashed or dotted dividers across the entire table, there would otherwise inevitably occur clashes between the verticals and the horizontals.
When I started out, I experimented with clines and the like, but I realized that drawing partial lines will cause small gaps in the borders of the cells that do not have a partial line — this is why I started to think about
subtables and/or minipages.
Below is a MWE of what I have right now. It looks like this:

What I'm trying to do here is to record the current position on the page, then look at the column widths and the minipage height, then derive the x and y values from those. I'm struggling with the units vs integers vs floats distinction and with the (apparently) differing frames of reference — sometimes
-y seems to be 'down', sometimes -y seems to be 'up'. But at this point I'm so confused I can hardly tell up from down!
Before I waste another day on this, does anyone have ideas on how to improve on this code? I've tried so many packages, and each is pretty much a law unto itself — the macro syntax, whether integers or floats or lengths are required for parameters, whether you can do math with them, and so on.
\documentclass{book}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\usepackage{multicol}
\setlength{\parindent}{0mm}
% http://tex.stackexchange.com/questions/56875/how-do-i-make-one-minipage-the-same-size-as-another
\usepackage{adjustbox}
% http://tex.stackexchange.com/a/37300/28067
\usepackage{zref-abspos}
\usepackage{zref-user}
\usepackage{calc}
\usepackage[absolute]{textpos}
\usepackage{epic}
\usepackage{fp}
% ----------------------------------------------------------------------------------------------------------
% http://tex.stackexchange.com/a/6424/28067
\makeatletter
\newcommand*{\DivideLengths}[2]{%
\strip@pt\dimexpr\number\numexpr\number\dimexpr#1\relax*65536/\number\dimexpr#2\relax\relax sp\relax
}
\makeatother
% ----------------------------------------------------------------------------------------------------------
% http://tex.stackexchange.com/a/37317/28067
\catcode`@=11
\begingroup
\catcode `P=12 % digits and punct. catcode
\catcode `T=12 % digits and punct. catcode
\lowercase{%
\def\x{\def\rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}}
\expandafter\endgroup\x%
\def\strip@pt{\expandafter\rem@pt\the}
\def\convertto#1#2{\strip@pt\dimexpr #2*65536/\number\dimexpr 1#1\relax\relax}
\catcode`@=12
% ##########################################################################################################
\begin{document}
% set units for package `textpos` (`textblock`)
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}
% set units for package `epic` (`dottedline`)
\unitlength1mm
% i set a definite width for the minipage here; in reality, that would be the text width inside a table
% cell:
\begin{minipage}[t]{20mm}
\begin{multicols}{2}%
\newcounter{flowX}
\newcounter{flowY}
\zsavepos{topleftcorner}%
\FPround\resultc{\convertto{mm}{\the\linewidth}}{0}
\setcounter{flowX}{\zposx{topleftcorner}/186450+\resultc+2} % `+2` to be replaced by 1/2 of columns divider width
\setcounter{flowY}{\zposy{topleftcorner}/186450}
\begin{textblock}{5}(\value{flowX},20)%
\leavevmode\dottedline[.]{1}(0,0)(0,20)%
\end{textblock}
A\\B\\C\\D\\E\\F\\G\\H\\I\\J\\K\\L\\M\\
\end{multicols}
\end{minipage}
% ##########################################################################################################
\end{document}

arydshlndoes not behave very well wrt other packages (you must use a definite loading order). also, it's all about dashed lines, and i want dotted lines. – flow Jun 23 '13 at 17:51arydshlnmyself), but Gonzalo mentions in his answer that you can get dotted lines with\hdashline[0.5pt/5pt]. – Xavier Jun 23 '13 at 18:27