n <- 100
x <- rnorm(n)
y <- 2*x + rnorm(n)
out <- lm(y ~ x)
library(xtable)
tab <- xtable(summary(out)$coef, digits=c(0, 2, 2, 1, 2))
print(tab, type="html")
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.22 0.10 -2.2 0.03
x 1.90 0.10 19.0 0.00