% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xl_sheet.R
\name{xl_colrow_spec}
\alias{xl_colrow_spec}
\alias{xl_col_spec}
\alias{xl_row_spec}
\title{Column and row specifications for a worksheet}
\usage{
xl_col_spec(
  cols,
  width = NA,
  hidden = NA,
  level = NA,
  format = NULL,
  width_pixels = NA,
  collapsed = NA,
  na = NA
)

xl_row_spec(
  rows,
  height = NA,
  hidden = NA,
  level = NA,
  format = NULL,
  height_pixels = NA,
  collapsed = NA
)
}
\arguments{
\item{cols}{Columns to target: a character vector of column names or a
numeric vector of 1-based positions.}

\item{width}{Column width (in Excel character units).}

\item{hidden}{Logical; hide the column/row.}

\item{level}{Integer outline (grouping) level, 0--7.}

\item{format}{An optional [xl_format] applied to the column/row as its
default cell format.  Combine groups with `+` (e.g.
`xl_font(bold = TRUE) + xl_fill(background = "yellow")`).}

\item{width_pixels, height_pixels}{The same geometry given in pixels instead.
Give one or the other, not both.  Excel stores character units and points,
so the pixel value is converted on the way in --- read back, a width set
as 100 pixels is 13.57 character units.}

\item{collapsed}{Logical; draw this column/row as the collapsed summary of
the group beside it.  Excel does not derive this --- the rows or columns
of the group itself need `hidden = TRUE` as well, exactly as clicking the
grouping symbol would leave them.}

\item{na}{What to write in this column where a value has none, overriding
the workbook's [xl_properties()]`(na = )`. `NA` (the default) inherits it.
Columns are where this usually belongs: a substitute that suits a numeric
column rarely suits a date one.}

\item{rows}{Rows to target: a numeric vector of 1-based data-row indices
(row 1 is the first data row, ignoring the header).}

\item{height}{Row height (in points).}
}
\value{
An `xl_col_spec` / `xl_row_spec` object (also an [xl_format]).
}
\description{
`xl_col_spec()` and `xl_row_spec()` describe formatting and geometry for a
set of columns or rows within a sheet built by [xl_sheet()].  They are
*subclasses* of [xl_format]: they carry the usual formatting groups (so they
combine with `+` and the group constructors) plus a target (which
columns/rows) and geometry (width/height, hidden, outline level).
}
\examples{
xl_col_spec("revenue", width = 14, format = xl_num_format("#,##0.00"))
xl_col_spec(c(1, 2), width = 10) + xl_font(bold = TRUE)
xl_col_spec("logo", width_pixels = 100)
xl_row_spec(1, height = 24, format = xl_font(bold = TRUE))
xl_row_spec(1, height_pixels = 40)
}
\seealso{
[xl_sheet], [xl_format]

Other worksheet layout:
\code{\link[=xl_outline]{xl_outline()}},
\code{\link[=xl_page_setup]{xl_page_setup()}},
\code{\link[=xl_sheet]{xl_sheet()}},
\code{\link[=xl_sheet_view]{xl_sheet_view()}}
}
\concept{worksheet layout}
