diff --git a/R/row_spec.R b/R/row_spec.R
index 3cd4808..f45cb3d 100644
--- a/R/row_spec.R
+++ b/R/row_spec.R
@@ -1,8 +1,7 @@
 #' Specify the look of the selected row
 #'
 #' @description This function allows users to select a row and then specify
-#' its look. Right now it supports the following two properties: bold text and
-#' italic text.
+#' its look. It can also specify the format of the header row when `row` = 0.
 #'
 #' @param kable_input Output of `knitr::kable()` with `format` specified
 #' @param row A numeric value or vector indicating which row(s) to be selected. You don't
@@ -13,10 +12,13 @@
 #' need to be emphasized.
 #' @param monospace A T/F value to control whether the text of the selected column
 #' need to be monospaced (verbatim)
-#' @param color A character string for column text color. Here please pay
+#' @param color A character string for row text color. Here please pay
 #' attention to the differences in color codes between HTML and LaTeX.
-#' @param background A character string for column background color. Here please
+#' @param background A character string for row background color. Here please
 #' pay attention to the differences in color codes between HTML and LaTeX.
+#' @param align A character string for cell alignment. For HTML, possible values could
+#' be `l`, `c`, `r` plus `left`, `center`, `right`, `justify`, `initial` and `inherit`
+#' while for LaTeX, you can only choose from `l`, `c` & `r`.
 #'
 #' @examples x <- knitr::kable(head(mtcars), "html")
 #' row_spec(x, 1:2, bold = TRUE, italic = TRUE)
@@ -24,7 +26,7 @@
 #' @export
 row_spec <- function(kable_input, row,
                      bold = FALSE, italic = FALSE, monospace = FALSE,
-                     color = NULL, background = NULL) {
+                     color = NULL, background = NULL, align = NULL) {
   if (!is.numeric(row)) {
     stop("row must be numeric. ")
   }
@@ -35,50 +37,49 @@
   }
   if (kable_format == "html") {
     return(row_spec_html(kable_input, row, bold, italic, monospace,
-                         color, background))
+                         color, background, align))
   }
   if (kable_format == "latex") {
     return(row_spec_latex(kable_input, row, bold, italic, monospace,
-                          color, background))
+                          color, background, align))
   }
 }
 
 row_spec_html <- function(kable_input, row, bold, italic, monospace,
-                          color, background) {
+                          color, background, align) {
   kable_attrs <- attributes(kable_input)
   kable_xml <- read_kable_as_xml(kable_input)
-  kable_tbody <- xml_tpart(kable_xml, "tbody")
 
-  group_header_rows <- attr(kable_input, "group_header_rows")
-  if (!is.null(group_header_rows)) {
-      row <- positions_corrector(row, group_header_rows,
-                                 length(xml_children(kable_tbody)))
+  if (!is.null(align)) {
+    if (align %in% c("l", "c", "r")) {
+      align <- switch(align, r = "right", c = "center", l = "left")
+    }
   }
 
-  for (j in row) {
-    target_row <- xml_child(kable_tbody, j)
-    for (i in 1:length(xml_children(target_row))) {
-      target_cell <- xml_child(target_row, i)
-      if (bold) {
-        xml_attr(target_cell, "style") <- paste0(xml_attr(target_cell, "style"),
-                                                 "font-weight: bold;")
-      }
-      if (italic) {
-        xml_attr(target_cell, "style") <- paste0(xml_attr(target_cell, "style"),
-                                                 "font-style: italic;")
-      }
-      if (monospace) {
-        xml_attr(target_cell, "style") <- paste0(xml_attr(target_cell, "style"),
-                                                 "font-family: monospace;")
-      }
-      if (!is.null(color)) {
-        xml_attr(target_cell, "style") <- paste0(xml_attr(target_cell, "style"),
-                                                 "color: ", color, ";")
-      }
-      if (!is.null(background)) {
-        xml_attr(target_cell, "style") <- paste0(xml_attr(target_cell, "style"),
-                                                 "background-color: ",
-                                                 background, ";")
+  if (0 %in% row) {
+    kable_thead <- xml_tpart(kable_xml, "thead")
+    original_header_row <- xml_child(kable_thead, length(xml_children(kable_thead)))
+    for (theader_i in 1:length(xml_children(original_header_row))) {
+      target_header_cell <- xml_child(original_header_row, theader_i)
+      xml_cell_style(target_header_cell, bold, italic, monospace, color, background, align)
+    }
+    row <- row[row != 0]
+  }
+
+  if (length(row) != 0) {
+    kable_tbody <- xml_tpart(kable_xml, "tbody")
+
+    group_header_rows <- attr(kable_input, "group_header_rows")
+    if (!is.null(group_header_rows)) {
+      row <- positions_corrector(row, group_header_rows,
+                                 length(xml_children(kable_tbody)))
+    }
+
+    for (j in row) {
+      target_row <- xml_child(kable_tbody, j)
+      for (i in 1:length(xml_children(target_row))) {
+        target_cell <- xml_child(target_row, i)
+        xml_cell_style(target_cell, bold, italic, monospace, color, background, align)
       }
     }
   }
@@ -88,15 +89,44 @@
   return(out)
 }
 
+xml_cell_style <- function(x, bold, italic, monospace, color, background, align) {
+  if (bold) {
+    xml_attr(x, "style") <- paste0(xml_attr(x, "style"),
+                                             "font-weight: bold;")
+  }
+  if (italic) {
+    xml_attr(x, "style") <- paste0(xml_attr(x, "style"),
+                                             "font-style: italic;")
+  }
+  if (monospace) {
+    xml_attr(x, "style") <- paste0(xml_attr(x, "style"),
+                                             "font-family: monospace;")
+  }
+  if (!is.null(color)) {
+    xml_attr(x, "style") <- paste0(xml_attr(x, "style"),
+                                             "color: ", color, ";")
+  }
+  if (!is.null(background)) {
+    xml_attr(x, "style") <- paste0(xml_attr(x, "style"),
+                                             "background-color: ",
+                                             background, ";")
+  }
+  if (!is.null(align)) {
+    xml_attr(x, "style") <- paste0(xml_attr(x, "style"),
+                                   "text-align: ", align, ";")
+  }
+  return(x)
+}
+
 row_spec_latex <- function(kable_input, row, bold, italic, monospace,
-                           color, background) {
+                           color, background, align) {
   table_info <- magic_mirror(kable_input)
   out <- enc2utf8(as.character(kable_input))
   row <- row + 1
   for (i in row) {
     target_row <- table_info$contents[i]
     new_row <- latex_new_row_builder(target_row, bold, italic, monospace,
-                                     color, background)
+                                     color, background, align)
     out <- sub(target_row, new_row, out, perl = T)
   }
 
@@ -106,7 +136,7 @@
 }
 
 latex_new_row_builder <- function(target_row, bold, italic, monospace,
-                                  color, background) {
+                                  color, background, align) {
   new_row <- latex_row_cells(target_row)
   if (bold) {
     new_row <- lapply(new_row, function(x) {
@@ -129,11 +159,19 @@
       paste0("\\\\textcolor{", color, "}{", x, "}")
     })
   }
+
+  if (!is.null(align)) {
+    new_row <- lapply(new_row, function(x) {
+      paste0("\\\\multicolumn{1}{", align, "}{", x, "}")
+    })
+  }
   new_row <- paste(unlist(new_row), collapse = " & ")
 
   if (!is.null(background)) {
     new_row <- paste0("\\\\rowcolor{", background, "}  ", new_row)
   }
 
+
+
   return(new_row)
 }
