diff --git a/R/add_indent.R b/R/add_indent.R
index c88b33d..18fdcd1 100644
--- a/R/add_indent.R
+++ b/R/add_indent.R
@@ -7,13 +7,14 @@
     return(kable_input)
   }
   if (kable_format == "html") {
-    return(kable_input)
+    return(add_indent_html(kable_input, positions))
   }
   if (kable_format == "latex") {
     return(add_indent_latex(kable_input, positions))
   }
 }
 
+# Add indentation for LaTeX
 add_indent_latex <- function(kable_input, positions) {
   table_info <- attr(kable_input, "original_kable_meta")
   if (is.null(table_info)) {
@@ -39,3 +40,38 @@
 latex_indent_unit <- function(rowtext) {
   paste0("\\\\hspace{1em}", rowtext)
 }
+
+# Add indentation for HTML
+add_indent_html <- function(kable_input, positions) {
+  kable_attrs <- attributes(kable_input)
+
+  kable_xml <- read_xml(as.character(kable_input), options = "COMPACT")
+  kable_tbody <- xml_tpart(kable_xml, "tbody")
+
+  group_header_rows <- attr(kable_input, "group_header_rows")
+  if (!is.null(group_header_rows)) {
+    positions <- positions_corrector(positions, group_header_rows,
+                                     length(xml_children(kable_tbody)))
+  }
+  for (i in positions) {
+    node_to_edit <- xml_child(xml_children(kable_tbody)[[i]], 1)
+    if (!xml_has_attr(node_to_edit, "indentLevel")) {
+      xml_attr(node_to_edit, "style") <- paste(
+        xml_attr(node_to_edit, "style"), "padding-left: 2em;"
+      )
+      xml_attr(node_to_edit, "indentLevel") <- 1
+    } else {
+      indentLevel <- as.numeric(xml_attr(node_to_edit, "indentLevel"))
+      xml_attr(node_to_edit, "style") <- sub(
+        paste0("padding-left: ", indentLevel * 2, "em;"),
+        paste0("padding-left: ", (indentLevel + 1) * 2, "em;"),
+        xml_attr(node_to_edit, "style")
+      )
+      xml_attr(node_to_edit, "indentLevel") <- indentLevel + 1
+    }
+  }
+  out <- structure(as.character(kable_xml), format = "html",
+                   class = "knitr_kable")
+  attributes(out) <- kable_attrs
+  return(out)
+}
