$(document).on("touchstart", ".tables th", function() {
$(this).addClass("active");
}).on("touchend", ".tables th", function() {
$(this).removeClass("active");
});
.tables th:hover, .tables th.active {background:#ddd;}
// генерируем данные
$elems = 10;
$column = 3;
$array = array();
for ($i = 1; $i <= $elems; $i++)
$array[] = $i;
// нарезка на столбики
$cols = array();
while ($column > 1 + count($cols)) {
$last = floor(count($array) / ($column - count($cols)));
list($array, $tail) = array_chunk($array, count($array) - $last);
$cols[] = $tail;
}
$cols[] = $array;
// выводим
for ($i = 0; $i < count($array); $i++) {
for ($j = $column - 1; $j >= 0; $j--) {
if (isset($cols[$j][$i])) echo $cols[$j][$i] . ' ';
}
echo "\n";
}