-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
302 lines (273 loc) · 10.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<!DOCTYPE html>
<html lang="en">
<head>
<link href='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css' rel='stylesheet' />
<link href='https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css' rel='stylesheet' />
<link href='https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.2.0/css/tableexport.css' rel='stylesheet' />
<link href='https://fonts.googleapis.com/css2?family=Oswald:wght@500&display=swap' rel='stylesheet' />
<title>Html to Excel</title>
</head>
<style>
body {
border-radius: border-box;
margin: 0;
padding: 0;
}
.main {
display: flex;
flex-direction: column;
}
.mainHeading {
background-color: #1a7343;
color: white;
height: 100px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Oswald', sans-serif;
}
.mainHeading h3 {
position: absolute;
right: 15px;
}
.mainHeading h3 a {
color: white;
}
.mainHeading h3 a:hover {
text-decoration: none;
color: rgba(255, 255, 255, 0.644);
}
code {
background: #dfe6e9;
border: 1px solid black;
width: 60vw;
padding: 10px 0;
padding-left: 24vw;
}
textarea {
width: 60vw;
}
.Upload {
width: 170px;
margin-right: 10px;
align-items: center;
}
.inputControl {
display: flex;
}
.preview {
display: none;
}
table,
.Upload,
textarea,
code,
#Copy {
margin-bottom: 10px;
}
button {
display: flex;
height: 50px;
width: 150px;
justify-content: center;
align-items: center;
font-size: large;
}
caption {
text-align: center;
}
caption button {
display: inline;
}
.csv,
.txt,
.xls {
margin-left: 10px;
}
#Copy {
width: auto;
}
.myBtn {
background-color: #1a7343;
border-color: #1a7343;
color: white;
font-size: large;
font-weight: 400;
}
.myBtn:hover {
background-color: #19663d;
}
.article {
display: flex;
background-color: black;
justify-content: center;
padding: 10px;
font-family: sans-serif;
}
article {
width: 80%;
color: white;
}
figure {
text-align: center;
}
article h5 a:hover {
text-decoration: none;
}
@media only screen and (max-width: 600px) {
code {
padding-left: 5%;
}
}
</style>
<body>
<div class="main">
<nav class="mainHeading">
<h1>Convert your HTML table to Excel file</h1>
<h3>
<a href="https://webstar600.blogspot.com/blog-page" target="_blank">About</a>
</h3>
</nav>
<h2>Copy & Paste your Code Here</h2>
<textarea cols="30" rows="10"></textarea>
<div class="inputControl">
<button type="submit" class="btn-primary Upload">Upload your code</button>
<button type="submit" class="btn-danger Clear">Clear</button>
</div>
<h2 class="preview">Preview your table</h2>
<table border="1" width="80%"></table>
<h2 id="example">Example Code</h2>
<code id="codeCopy">
<thead><br />
<tr><br />
<th>S.No</th><br />
<th>Name</th><br />
<th>Class</th><br />
<th>Roll No.</th><br />
</tr><br />
</thead><br />
<tbody><br />
<tr><br />
<td>1</td><br />
<td>John Doe</td><br />
<td>6</td><br />
<td>1</td><br />
</tr><br />
<tr><br />
<td>2</td><br />
<td>Jane Doe</td><br />
<td>7</td><br />
<td>2</td><br />
</tr><br />
</tbody>
</code>
<button type="submit" class="btn-secondary" id="Copy" data-clipboard-target="#codeCopy">Copy the code</button>
</div>
<div class="article">
<article>
<h1 style="text-align: center;">Convert HTML Table to Excel [Xls/CSV] and Text [txt]</h1><br />
<h5>Convert Html table code into Excel and even into a txt file. Export your Html to XLS (Excel workbook), Html to CSV (Comma-Separated Values), Html to txt (Text).</h5><br />
<figure><img src="https://i.pinimg.com/564x/51/42/15/514215be30c934de2f62d11c3f3b904c.jpg" alt="Convert HTML Table to Excel [Xls/CSV] and Text [txt]" width="80%" height="400" />
<figcaption>Export Html to Excel</figcaption>
</figure>
<h2 style="text-align: center;">
About this Html to Excel Converter</h2><br />
<span style="color: #666666;">Hello, and welcome to everyone on my HTML to Excel converter. Recently I was having a problem with converting my HTML code into an excel file. We searched the whole internet and found nothing which can help me. So here, We are with the
converter that can convert your Html code into an Excel file.<br />
<br />Convert your HTML table code into Excel and even into a text file.</span><br /><br />
<h2 style="text-align: center;">
What do I mean by Exporting or Converting your HTML into Excel FIle</h2>
<br />
<ul style="text-align: left;">
<li><span style="color: #666666;">Html to Xls (Excel workbook)</span></li>
<span style="color: #666666;">
</span>
<li><span style="color: #666666;">Html to CSV (Comma-Separated Values)</span></li>
<span style="color: #666666;">
</span>
<li><span style="color: #666666;">Html to txt (Text)</span></li>
</ul>
<h2 style="text-align: center;">
HTML to Excel Converter free download</h2>
<br /><span style="color: #666666;">Yes, you heard it well. You can download your Excel file for free, whether it be in Xls or CSV, even you can download the text file for free.</span><br /><br />
<h2 style="text-align: center;">
How to use this HTML to excel converter</h2>
<br /><span style="color: #666666;">First of all, you need to have the HTML table code with html5 format. Don’t worry if you have any trouble with html5 go to the given an example and check the form of how your Code should look like before exporting it</span>.<br
/>
<h5 style="text-align: left;">
<span style="color: #cccccc;"><a href="#example">Check the example</a></span></h5>
<br /><span style="color: #666666;">After getting the code in the given format, copy and paste it to the text area and click Upload your code.<br />
<br />After uploading it, you can preview your table.<br />
<br />If everything is correct Export your Excel file, we will recommend you to export it in CSV file. For device compatibilities.</span>
</br>
</article>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
<script src="https://cdn.jsdelivr.net/npm/file-saver@2.0.2/dist/FileSaver.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.2.0/js/tableexport.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xls/0.7.6/xls.core.min.js"></script>
<script>
$(document).ready(function() {
$(".Upload").click(function() {
htmlCode = $("textarea").val();
if (htmlCode !== "" && htmlCode.includes("<tr>")) {
$(".preview").css("display", "block");
$("table").empty().append(htmlCode);
previewTable = $("table").text();
if (previewTable !== "") {
$("table").tableExport({
formats: ["xls", "csv", "txt"],
});
$("caption button").addClass("myBtn");
$(".csv").attr({
title: "Recommended",
"data-tooltip": "tooltip"
});
$('[data-toggle="tooltip"]').tooltip();
} else {
Swal.fire({
title: 'Please Upload your Code First!',
showClass: {
popup: 'animated fadeInDown faster'
},
hideClass: {
popup: 'animated fadeOutUp faster'
}
});
}
} else if (htmlCode == "") {
Swal.fire({
title: 'Please Insert Your Code!',
showClass: {
popup: 'animated fadeInDown faster'
},
hideClass: {
popup: 'animated fadeOutUp faster'
}
});
} else {
Swal.fire({
icon: 'error',
title: 'Oops...',
text: 'Please check your code!',
footer: '<a href="#example">See the example code</a>'
});
}
});
$("#Copy").click(function() {
$(this).text("Copied!").addClass("btn-dark").removeClass("btn-secondary");
});
$(function() {
new Clipboard('#Copy');
});
$(".Clear").click(function() {
$("textarea").val("");
});
});
</script>
</body>
</html>