lightswitch05 / table-to-json

Serializes HTML tables into JSON objects.
http://lightswitch05.github.io/table-to-json/
MIT License
756 stars 172 forks source link

Add options "formatHeader" and "allValueTag" #13

Closed lfneves closed 10 years ago

lfneves commented 10 years ago

formatHeader : Boolean to format the header removing spaces and special characters, default false

allValueTag : Boolean get values in input, select and textarea inside all <td> tags, default false

lightswitch05 commented 10 years ago

@lfneves can you please explain to me what you are using table-to-json for and why you need these changes? I would like to help you solve your problems with table-to-json, but I cannot help if you do not explain the problems. The changes you are making not only fail the tests, but they go directly against my preferred coding standard of 2 spaces for indentation and no tabs. If you would like to develop for table-to-json, you need to install Node.js and Grunt. Grunt runs the lint validation and tests, if all that passes, then it creates the minimized version of table-to-json. Please spend some time learning these tools to test and validate your changes before submitting pull requests. I am happy to make code changes for you if you can explain to me what you need table-to-json to do, and why it is not currently able to help you with your goal.

lfneves commented 10 years ago

@lightswitch05 I need to make these changes to format header of table to eliminate special word characters and spaces, second alteration (allValueTag), when i have inside my <td> tag <input>, <select> or <textarea> i want get value inside of these elements to send ajax post. I will make some testing and changes before pull request as soon possible, thanks.

lightswitch05 commented 10 years ago

@lfneves if you would like to override the names of the heading, you can use data-override="name" in the heading HTML. You could also just supply the names of the headers using the headings option. Getting the values of <input> tags is a good idea, but needs to be done carefully not to mess up existing functionality. I don't mind adding that feature for you if you want it.

lfneves commented 10 years ago

@lightswitch05 maybe the headings can resolve my problem in the heading HTML, I need make some testings. I have adding feature to getting values of <input> tags, but i will make some changes and improvements.