diff --git a/R/add_indent.R b/R/add_indent.R
index 3f57862..098989c 100644
--- a/R/add_indent.R
+++ b/R/add_indent.R
@@ -5,6 +5,7 @@
 #' be indented.
 #' @param level_of_indent a numeric value for the indent level. Default is 1.
 #' @param all_cols T/F whether to apply indentation to all columns
+#' @param target_cols A vector of numeric column positions. Default is 1.
 #'
 #' @examples
 #' \dontrun{
@@ -15,7 +16,8 @@
 #'
 #' @export
 add_indent <- function(kable_input, positions,
-                       level_of_indent = 1, all_cols = FALSE) {
+                       level_of_indent = 1, all_cols = FALSE,
+                       target_cols = 1) {
 
   if (!is.numeric(positions)) {
     stop("Positions can only take numeric row numbers (excluding header rows).")
@@ -28,16 +30,17 @@
     return(kable_input)
   }
   if (kable_format == "html") {
-    return(add_indent_html(kable_input, positions, level_of_indent, all_cols))
+    return(add_indent_html(kable_input, positions, level_of_indent, all_cols, target_cols))
   }
   if (kable_format == "latex") {
-    return(add_indent_latex(kable_input, positions, level_of_indent, all_cols))
+    return(add_indent_latex(kable_input, positions, level_of_indent, all_cols, target_cols))
   }
 }
 
 # Add indentation for LaTeX
 add_indent_latex <- function(kable_input, positions,
-                             level_of_indent = 1, all_cols = FALSE) {
+                             level_of_indent = 1, all_cols = FALSE,
+                             target_cols = 1) {
   table_info <- magic_mirror(kable_input)
   out <- solve_enc(kable_input)
   level_of_indent<-as.numeric(level_of_indent)
@@ -57,18 +60,22 @@
 
   for (i in positions + table_info$position_offset) {
     rowtext <- table_info$contents[i]
+    new_rowtext <- unlist(latex_row_cells(rowtext))
     if (all_cols) {
-      new_rowtext <- latex_row_cells(rowtext)
       new_rowtext <- lapply(new_rowtext, function(x) {
         paste0("\\\\hspace\\{", level_of_indent ,"em\\}", x)
       })
       new_rowtext <- paste(unlist(new_rowtext), collapse = " & ")
     } else {
-      new_rowtext <- latex_indent_unit(rowtext, level_of_indent)
+      if (all(target_cols %in% seq_along(new_rowtext))) {
+        new_rowtext[target_cols] <- latex_indent_unit(new_rowtext[target_cols], level_of_indent)
+      } else {
+        stop("There aren't that many columns in the row. Check target_cols in ",
+         "add_indent_latex.")
+      }
     }
-    out <- sub(paste0(rowtext, "(\\\\\\\\\\*?(\\[.*\\])?\n)"),
-               paste0(new_rowtext, "\\1"),
-               out, perl = TRUE)
+    new_rowtext <- paste(unlist(new_rowtext), collapse = " & ")
+    out <- sub(rowtext, new_rowtext, out, perl = TRUE)
     table_info$contents[i] <- new_rowtext
   }
   out <- structure(out, format = "latex", class = "knitr_kable")
@@ -86,7 +93,8 @@
 
 # Add indentation for HTML
 add_indent_html <- function(kable_input, positions,
-                            level_of_indent = 1, all_cols = FALSE) {
+                            level_of_indent = 1, all_cols = FALSE,
+                            target_cols = 1) {
   kable_attrs <- attributes(kable_input)
 
   kable_xml <- kable_as_xml(kable_input)
@@ -102,8 +110,6 @@
     row_to_edit = xml_children(kable_tbody)[[i]]
     if (all_cols) {
       target_cols = 1:xml2::xml_length(row_to_edit)
-    } else {
-      target_cols = 1
     }
 
     for (j in target_cols) {
