% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/borders.R
\name{hline_top}
\alias{hline_top}
\title{Set the top border of a table part}
\usage{
hline_top(x, j = NULL, border = NULL, part = "body")
}
\arguments{
\item{x}{a 'flextable' object, see \link{flextable-package} to learn how to create
'flextable' object.}

\item{j}{column selector, see section \emph{Column selection with the \code{j} parameter}
in <\code{\link[=flextable_selectors]{Selectors in flextable}}>.}

\item{border}{border properties defined by a call to
\code{\link[officer:fp_border]{officer::fp_border()}}}

\item{part}{part selector, see section \emph{Part selection with the \code{part}
parameter} in <\code{\link[=flextable_selectors]{Selectors in flextable}}>.
Value 'all' can be used.}
}
\description{
\code{hline_top()} draws a horizontal line at the \strong{very top} of a
table part. It does not accept a row selector \code{i} because it
always targets the first row.

When the part above exists (e.g. header above body), the line
is stored as the bottom border of that adjacent part so that
it renders seamlessly.

Unlike \code{\link[=hline]{hline()}}, which adds inner lines below arbitrary rows,
\code{hline_top()} is meant for the outer top edge of a part.
}
\examples{
library(officer)
big_border <- fp_border(color = "orange", width = 3)

ft <- flextable(head(iris))
ft <- border_remove(x = ft)

# add a thick line on top of each part
ft <- hline_top(ft, part = "all", border = big_border)
ft
}
\seealso{
Other borders management:
\code{\link[=border_inner]{border_inner()}},
\code{\link[=border_inner_h]{border_inner_h()}},
\code{\link[=border_inner_v]{border_inner_v()}},
\code{\link[=border_outer]{border_outer()}},
\code{\link[=border_remove]{border_remove()}},
\code{\link[=hline]{hline()}},
\code{\link[=hline_bottom]{hline_bottom()}},
\code{\link[=surround]{surround()}},
\code{\link[=vline]{vline()}},
\code{\link[=vline_left]{vline_left()}},
\code{\link[=vline_right]{vline_right()}}
}
\concept{borders management}
