bug fix
diff --git a/R/column_spec.R b/R/column_spec.R
index bc8ef7e..9748713 100644
--- a/R/column_spec.R
+++ b/R/column_spec.R
@@ -13,7 +13,8 @@
 #' @param italic A T/F value to control whether the text of the selected column
 #' need to be emphasized.
 #' @export
-column_spec <- function(kable_input, column, width, bold = F, italic = F) {
+column_spec <- function(kable_input, column,
+                        width = NULL, bold = F, italic = F) {
   if (!is.numeric(column)) {
     stop("column must be a numeric value")
   }
@@ -36,7 +37,7 @@
   kable_tbody <- xml_tpart(kable_xml, "tbody")
 
   group_header_rows <- attr(kable_input, "group_header_rows")
-  all_contents_rows <- seq(1, length(kable_tbody))
+  all_contents_rows <- seq(1, length(xml_children(kable_tbody)))
   if (!is.null(group_header_rows)) {
     all_contents_rows <- all_contents_rows[!all_contents_rows %in%
                                              group_header_rows]