Comments (8)
To remove columns i am using this
$(o).find("tr").not(e.settings.exclude).each(function (i, o) { var cloneRow = $(o).clone(); $(cloneRow).find(e.settings.exclude).remove(); var html = $(cloneRow).html(); tempRows += "<tr>" + html + "</tr>"; });
from jquery-table2excel.
Any tr tag you add class=".noExl" will be excluded. I haven't tried it for th though, why don't you try and see if it works?
from jquery-table2excel.
col and col group were deprecated in HTML 4.01 and the reality is there aren't "columns" in an html table which makes manipulating them very tricky.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup
As ferman2147 suggested, the plugin already supports row exclusion using the .noExl class. It wouldn't be hard to add individual cell exclusion and then it would be up to you to ensure all the cells in a "column" were marked and then you could implicitly exclude them.
TODO: Add individual cell exclusion using .noExl
from jquery-table2excel.
ya @ferman2147 , i've try before but no luck, and @rainabba I add individual cell exclusion using .noExl in the same column not work too, so I create another code outside like this one to remove a column.
$('table').delegate('td,th', 'click', function() {
var index = this.cellIndex;
$(this).closest('table').find('tr').each(function() {
this.removeChild(this.cells[ index ]);
});
});
any suggestion how to include in this plugin?
from jquery-table2excel.
What you need to do is pretty simple. Here is a screenshot for you. Note that you should give the id attribute to your table like < table id="myTable". (Looking at the the screenshot I realised that I forgot to do so.;) )
from jquery-table2excel.
Thanks https://github.com/nshah31 (nshah31)..
Above Solution works perfectly when we comment the following code and add above code in jquery.table2excel.js -->>
// $(o).find("tr").not(e.settings.exclude).each(function (i,o) {
// tempRows += "<tr>" + $(o).html() + "</tr>";
// });
Thank you once again
from jquery-table2excel.
Can you explain me please what have you done? I've added nshah31's code and i've commented the one you mentioned, but when i try to add the noExl class to a or element, it's still not working...
from jquery-table2excel.
@Kalemstorm94 on line #54 or near by you would find following code
$(o).find("tr").not(e.settings.exclude).each(function (i,o) {
tempRows += "<tr>" + $(o).html() + "</tr>";
}); //comment this code
and just after this add this following code
//To Exclude the columns
$(o).find("tr").not(e.settings.exclude).each(function (i, o) { var cloneRow = $(o).clone(); $(cloneRow).find(e.settings.exclude).remove(); var html = $(cloneRow).html(); tempRows += "<tr>" + html + "</tr>"; });
e.tableRows.push(tempRows);
That's it it will work fine.
Hope this helps
from jquery-table2excel.
Related Issues (20)
- Planning an update to this project HOT 1
- Problem using this plugin combined with SharePoint Framework
- Css doesn't work HOT 1
- Not An Issue - But Your Plugin Is Much More Efficient Than TableExport HOT 1
- when table content having phone no then excel sheet don't show it properly HOT 1
- 消除科学计数 HOT 1
- Doesn't export no error messages
- Can this plugin do AutoFilter (in spreadsheet)? HOT 1
- Issue with tags and bower HOT 2
- [display: none;] <- it had no effect.????? HOT 2
- Style not work in libreoffice
- How put 2 tables in line?
- xlsx file creation HOT 2
- Export table with pagination HOT 2
- Apply cell format to 'Text' HOT 2
- the format does not match the extension (office) HOT 2
- Nested Table issue
- How to export select rows,no unselected columns!
- can this plugin export excel with "border"?
- Uncaught SyntaxError: expected expression, got '<' HOT 1
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 jquery-table2excel.