diff --git a/R/add_indent.R b/R/add_indent.R
new file mode 100644
index 0000000..c88b33d
--- /dev/null
+++ b/R/add_indent.R
@@ -0,0 +1,41 @@
+#' Add indentations to row headers
+#' @export
+add_indent <- function(kable_input, positions) {
+  kable_format <- attr(kable_input, "format")
+  if (!kable_format %in% c("html", "latex")) {
+    message("Currently generic markdown table using pandoc is not supported.")
+    return(kable_input)
+  }
+  if (kable_format == "html") {
+    return(kable_input)
+  }
+  if (kable_format == "latex") {
+    return(add_indent_latex(kable_input, positions))
+  }
+}
+
+add_indent_latex <- function(kable_input, positions) {
+  table_info <- attr(kable_input, "original_kable_meta")
+  if (is.null(table_info)) {
+    table_info <- magic_mirror(kable_input)
+  }
+
+  if (!is.numeric(positions)) {
+    stop("Positions can only take numeric row numbers (excluding header rows).")
+  }
+  if (max(positions) > table_info$nrow - 1) {
+    stop("There aren't that many rows in the table. Check positions in ",
+         "add_indent_latex.")
+  }
+
+  out <- kable_input
+  for (i in positions) {
+    rowtext <- table_info$contents[i + 1]
+    out <- sub(rowtext, latex_indent_unit(rowtext), out)
+  }
+  return(out)
+}
+
+latex_indent_unit <- function(rowtext) {
+  paste0("\\\\hspace{1em}", rowtext)
+}
