[R] improve formatting of HTML table

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Aug 11 18:07:58 CEST 2011


Please report to the package maintainer.

Uwe Ligges

On 11.08.2011 18:04, Juliet Hannah wrote:
> I am trying to improve the look of an HTML table for a report (that
> needs to be pasted into Word).
>
> Here is an example.
>
> table2<- structure(c(26L, 0L, 40L, 0L, 10L, 0L, 0L, 188L, 0L, 281L, 0L,
> 0L, 0L, 0L, 0L, 0L, 0L, 4L), .Dim = c(6L, 3L), .Dimnames = structure(list(
>      myvar = c("Don't know", "Somewhat likely", "Somewhat unlikely",
>      "Very likely", "Very unlikely", NA), var_recode = c("0", "1",
>      NA)), .Names = c("myvar", "var_recode")), class = "table")
>
>
> library("R2HTML")
> .HTML.file = paste(getwd(), "/example.html", sep = "")
> HTML(table2)
>
>
> In the output, I would like to improve the justification of the
> numbers (or any other suggestion to make
> the HTML look nicer). The columns are a little hard to read.
>
> Thanks.
>
>> sessionInfo()
> R version 2.13.1 (2011-07-08)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
> States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] R2HTML_2.2
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list