% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/splitters.R
\name{split_columns}
\alias{split_columns}
\title{Split a flextable into pages by columns}
\usage{
split_columns(x, max_width, rep_cols = NULL, unit = "in")
}
\arguments{
\item{x}{a 'flextable' object, see \link{flextable-package} to learn how to create
'flextable' object.}

\item{max_width}{Maximum width for each page (in inches by default).}

\item{rep_cols}{Columns to repeat on every page. Can be a character
vector of column names or an integer vector of column positions.
\code{NULL} (default) means no repetition. Repeated columns appear at
the beginning of each page in the order specified.}

\item{unit}{Unit for \code{max_width}, one of \code{"in"}, \code{"cm"}, \code{"mm"}.}
}
\value{
A list of flextable objects. If no splitting is needed, a
single-element list is returned.
}
\description{
Split a flextable into a list of flextables whose columns
fit within a given width (in inches). This is useful for paginating
wide tables in Word or PowerPoint output.
}
\examples{
ft <- flextable(head(mtcars))
ft_pages <- split_columns(ft, max_width = 5)
length(ft_pages)
}
\seealso{
Other row and column operations:
\code{\link[=add_body]{add_body()}},
\code{\link[=add_body_row]{add_body_row()}},
\code{\link[=add_footer]{add_footer()}},
\code{\link[=add_footer_lines]{add_footer_lines()}},
\code{\link[=add_footer_row]{add_footer_row()}},
\code{\link[=add_header]{add_header()}},
\code{\link[=add_header_lines]{add_header_lines()}},
\code{\link[=add_header_row]{add_header_row()}},
\code{\link[=delete_columns]{delete_columns()}},
\code{\link[=delete_part]{delete_part()}},
\code{\link[=delete_rows]{delete_rows()}},
\code{\link[=paginate]{paginate()}},
\code{\link[=separate_header]{separate_header()}},
\code{\link{set_header_footer_df}},
\code{\link[=set_header_labels]{set_header_labels()}},
\code{\link[=split_rows]{split_rows()}},
\code{\link[=split_to_pages]{split_to_pages()}}
}
\concept{table_structure}
