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

\item{max_height}{Maximum height for each page, including
header and footer (in inches by default).}

\item{group}{Integer vector of body row indices that start a new group.
Rows belonging to the same group are kept together on a single page.
Default is \code{integer(0)} (no grouping, every row is independent).}

\item{unit}{Unit for \code{max_height}, 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 body
rows fit within a given height (in inches). Header and footer are
repeated on every page. An optional \code{group} argument keeps row groups
together (no page break inside a group).
}
\note{
Footnotes are currently repeated on every page, even when
they reference rows that only appear on a specific page. This
limitation will be resolved in a future version when footnotes
are restructured to track their association with body rows.
}
\examples{
ft <- flextable(iris)
ft_pages <- split_rows(ft, max_height = 3)
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_to_pages]{split_to_pages()}}
}
\concept{table_structure}
