# \donttest{
X <- rnorm(125, sd=100)
Group <- factor(sample(letters[1:5], 125, replace = TRUE))
tab <- tabular( Group ~ (N=1)+Format(digits=2)*X*((Mean=mean) + Heading("Std Dev")*sd) )
save <- table_options()
table_options(rowlabeljustification="c")
f <- tempfile(fileext=".html")
con <- file(f, "wt")
if (interactive())
toHTML(tab, con, options=htmloptions(head=TRUE, table=FALSE))
writeLines("This table has pad = FALSE. The centered numbers look
sloppy.", con)
if (interactive())
toHTML(tab, con, options=htmloptions(head=FALSE, table=TRUE, pad=FALSE))
writeLines("This table has pad = FALSE and justification=\"r\".
The justification makes the columns of numbers look all right (except
for the hyphens used as minus signs), but they are placed poorly
relative to the labels.", con)
if (interactive())
toHTML(tab, con, options=htmloptions(head=FALSE, table=TRUE, pad=FALSE, justification="r"))
writeLines("This one has pad = TRUE. It looks best, but if you cut
and paste, the spacing characters may cause problems.", con)
if (interactive())
toHTML(tab, con, options=htmloptions(head=FALSE, table=TRUE, pad=TRUE))
table_options(save)
close(con)
if (interactive())
browseURL(f)
# }
Run the code above in your browser using DataLab