add collapse_rows html
diff --git a/R/util.R b/R/util.R
index 90c84bc..3f5c470 100644
--- a/R/util.R
+++ b/R/util.R
@@ -55,3 +55,15 @@
 latex_row_cells <- function(x) {
   strsplit(x, " \\& ")
 }
+
+collapse_row_matrix <- function(kable_dt, columns)  {
+  mapping_matrix <- list()
+  for (i in columns) {
+    mapping_matrix[[paste0("x", i)]] <- unlist(lapply(
+      rle(kable_dt[, i])$length, function(x) {
+      c(x, rep(0, x - 1))
+      }))
+  }
+  mapping_matrix <- data.frame(mapping_matrix)
+  return(mapping_matrix)
+}