javascript - display a table from a excel sheet -
I want to display the table in my html page with an Excel sheet. There are several tables in excel sheet, I want to display a specific table. Please help ..
The HTML code that I used to extract information from the Excel file
& lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; From Excel to & lt; / Title & gt; & Lt; Script language = "javascript" & gt; GetData (cell, row) function {var excel = new ActiveXObject ("Excel.Application"); Var excel_file = excel.Workbooks.Open ("C: \\ abc.xlsx"); Var excel_sheet = excel.Worksheets ("25 pe"); Var data = excel_sheet.Cells (cell, line). value; Document.getElementById ('div1'). InnerText = Data; } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "div1" style = "background: #dfdff; width: '100%';" Align = "center" & gt; C: \ abc.xlsx & lt; / Div & gt; Click on the button to get data from & lt; Input name = "button1" type = "button" onClick = "GetData (1,1)" value = "button1" & gt; & Lt; Input name = "button2" type = "button" onClick = "GetData (1,2)" value = "button2" & gt; & Lt; Input name = "button3" type = "button" onClick = "GetData (2,1)" value = "button3" & gt; & Lt; Input name = "button4" type = "button" onClick = "GetData (2,2)" value = "button4" & gt; & Lt; / Body & gt; & Lt; / Html & gt; This code removes one cell at a time. How do I want to remove the entire table once?
A good option is to use jquery library dataTables if you can then use a tool like That's what Mr. Dataconer provided for converting Mr. Spreadsheets into Jason. You can then point out your data in the Jason file, filter it without any columns, and viola, your data is displayed in a good HTML table, and how do you like it. I have used this approach lately and it has displayed a lot of data which is very easy
Datatiles -
Mr. Data Converter -
To hide different columns, the code will look something like this in your DataTable Initializer:
"aoColumnDefs": [{"bvisible": incorrect, "bSearchable": true, "aTargets": [0, 1, 4, 6, 9, 10, 11, 12]} and again the order column will look something like this:
" {"MDataProp": [1]}, {"mDataProp": [2]}, {"mDataProp": [7]}, {"m DataProp ": [4]},], Hope this is of some help ...
Comments
Post a Comment