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

\item{max_width}{Maximum width per page (in inches by default).
\code{NULL} means no column splitting.}

\item{max_height}{Maximum height per page, including header and
footer (in inches by default). \code{NULL} means no row splitting.}

\item{rep_cols}{Columns to repeat on every horizontal page. Can be
a character vector of column names, an integer vector of column
positions, or \code{NULL} (default, no repetition).}

\item{group}{Integer vector of body row indices that start a new
group. Default is \code{integer(0)}.}

\item{unit}{Unit for \code{max_width} and \code{max_height}, one of
\code{"in"}, \code{"cm"}, \code{"mm"}.}
}
\value{
A list of flextable objects.
}
\description{
Split a flextable into a list of flextables that fit
within the given height and width constraints. Rows are split
first, then columns are split within each row page.

This is a convenience wrapper around \code{\link[=split_rows]{split_rows()}} and
\code{\link[=split_columns]{split_columns()}}.
}
\examples{
ft <- flextable(iris)
ft_pages <- split_to_pages(ft, max_width = 4, max_height = 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_columns]{split_columns()}},
\code{\link[=split_rows]{split_rows()}}
}
\concept{table_structure}
