Open ChengQian123 opened 7 years ago
The empty column is a odd design choice that I've made on purpose. I like underlining the headers and this was the only way that I got it to work. The table you suggest is actually rather trivial to generate and perhaps some of the simpler table packages have a better solution. You could try to do str_replace
on "<td> </td>"
but it's only a hack.
Thanks for your solutions. I think you can consider embed the option dropping empty column in this function. :)
I have nothing against adding this functionality but I currently lack the time for implementing this. Help is always welcome and it shouldn't be that tricky if you want to give it a try. Basically:
skip_separator_cols
(I think drop_empty_cols
will be confusing as most don't reflect over these columns.<td> </td>
.colspan
so that it ignores the empty columns.Push everything to the develop
branch and then do a pull request.
Doesn't this do it? I'm not positive how colspan
needs to be fixed.
library('htmlTable')
ht <- ht0 <- htmlTable(
head(mtcars),
cgroup = c('', 'asdf', '', 'asdf'),
n.cgroup = c(2,4,2,3)
)
ht <- gsub('<t[dh][^>]+?> </t[hd]>', '', ht)
ht
ht0
Hi Max,
htmlTable() creates three-line tables as its default results. But i want to draw all td borders in my tables. My table using this function is below:
Blank columns among cgroups are not what i want.
So,two questions:
And this is what i want:
So how can i do that using htmlTable()?
Thanks so much! Qian