Comments (2)
Both dom and tableTools need to be part of options=list(). In your example, they are external to it.
Try this:
library(DT)
# a custom table container
sketch = htmltools::withTags(table(
class = 'display',
thead(
tr(
th(rowspan = 2, 'Current Industry'),
th(colspan = 3, 'Share of Workers'),
th(colspan = 3, 'Share of Workers w/a Pro Cert (Q1)'),
th(colspan = 3, 'Share of Workers w. Certificate (Q10)')
),
tr(
lapply(rep(c('Overall', 'Male', 'Female'), 3), th)
)
)
))
table1 = structure(c(4570, 8980, 6e-04, 0.0067, 0.8455, 0.1154, 0.1545,
0.8846, 0.6998, 0.6348, 0.9416, 0.1349, 0.0584, 0.8651, 0.1742,
0.2279, 1, 0.1568, 0, 0.8432), .Dim = c(2L, 10L), .Dimnames = list(
NULL, c("industry", "Overall1", "Male1", "Female1", "Overall2",
"Male2", "Female2", "Overall3", "Male3", "Female3")))
datatable(table1, extensions = 'TableTools',
filter = 'top', container = sketch, caption = 'Table 1: Certification by industry',
rownames = FALSE,
options = list(pageLength = 15, lengthMenu = c(5, 10, 15, 50, 100),
dom = 'T<"clear">lfrtip',
tableTools = list(sSwfPath = copySWF())
)
) %>%
formatPercentage(2:10, 2)
Hope it helps.
from dt.
I think @phillc73 is exactly correct. Thanks!
from dt.
Related Issues (20)
- two "remove" icons in filtered filter = 'top'? HOT 2
- plugins = 'natural' not working for DT v > .27? HOT 3
- 503 error with very large http cookies
- Issue using `replaceData()` with `dataTableProxy()` HOT 4
- `formatStyle()` doesn't work with Bootstrap 5 HOT 5
- Cannot be rendered correctly in Shiny app with tailwind css HOT 3
- some selected rows loose bg (bootstrap 5, rowGroup extension, selection)
- Selection of multiple levels HOT 2
- [Accessibility] Trigger custom row select from Javascript callback HOT 11
- R shiny DT table with pagination and drop down list inside table and being able to save the entire updated table as csv file HOT 5
- DT 0.31 breaks previous 'ignore colnames' behavior during `replaceData()` HOT 1
- RowGroup extension with rownames = TRUE HOT 6
- updateSearch does not update numeric slider values
- datatable column filters clash with shiny::selectizeInput when invoked first HOT 4
- DateTime date picker CSS is broken in SearchBuilder
- Disabling editable table by row (and not just by column)
- autoFill extension returns `NaN` instead of incrementing HOT 5
- Docs do not state whether shift+click works for multi-row selection
- #828 breaks maintaining selected columns upon re-render HOT 3
- signif() + datatable() bug HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dt.