I was recently working on a simple Excel sheet that I needed to add as a table on a webpage. The first thought that crossed my mind was to manually write the HTML code for the data table in the sheet. While you can do that, it’s quite tedious and time-consuming. Why waste so much energy when you can achieve that in a minute or two? Let’s check 3 easy methods to convert Excel cells to HTML table format.
To display spreadsheet data in an HTML table, you can use the native feature in Excel to convert sheets to webpages. If the generated code doesn’t seem clean, you can either try HTML editors online or use dedicated online tools to convert Excel sheets to HTML.
Let’s get started on converting Excel sheets to HTML tables that you can add on websites.
1. Use HTML Editor
The simplest method is to copy the cells from your Excel sheet and paste them in an HTML editor. That will automatically generate the required code for the HTML table. Here are the steps in detail:
Step 1: Open your Excel sheet. Copy the cells containing your data. Use the Ctrl + C keyboard shortcut to copy the cells.
Step 2: Now open any HTML editor. You can use the online HTML editors too. I can recommend https://html-online.com/editor/ for now. Open it and paste the copied cells in the box on the left side.
Immediately when you paste it, the editor will generate your HTML code for the table. It will be a basic table. You can format it later as per your requirements.
Excel lets you save your documents in different formats. One of them is an HTML webpage. You can use this feature to convert an Excel sheet to an HTML document. However, that adds a lot of extra code which might be unnecessary if you are trying to convert a simple table. If you are familiar with HTML coding, you can remove those extra lines.
Here are the steps to convert Excel to HTML using save as webpage:
Step 1: Launch the Excel sheet that you want to convert.
Step 2: Click on the File option at the top and choose Save As. Select the folder where you want to save the generated HTML file.
Step 3: The Save As dialog box will open. Click on the Save as type drop-down box and choose Web page.
Step 4: If you have multiple worksheets choose Entire Workbook next to the Save option. If it’s a simple table, select Selection. Click on Save
Step 5: Another pop-up window will open. Click on Publish.
The file will be saved as an HTML page. To view its code, follow the instructions given below.
View HTML Code for a Webpage
Navigate to the folder where you saved the HTML file. Then, double-click on it to preview the file in a browser.
To copy the HTML code, right-click on the file and choose Open with. Select your HTML editor if it’s installed on your PC or choose any regular text editor such as Notepad or its alternatives.
Here’s a snapshot of how the HTML code looks like using this method:
Also on Guiding Tech
3. Use Online Tools to Convert Excel to HTML Table
Various online tools exist that let you convert your Excel documents to HTML. You need to add your Excel sheet, and they will show the HTML code. There are two websites that I like. Let’s check the steps for both of them.
Step 2: Click on the Browse button. Select the file that you want to convert.
The generated HTML code will display in the box below. You can either copy-paste it or click on the Download button to save it as a TXT file.
Also on Guiding Tech
It’s quite easy to convert your sheets to HTML tables automatically. Some of the methods may add extra code that can be removed easily. If you are new to HTML, check W3Schools.com for tips on using HTML.
Online HTML editors are a great alternative to apps. Find out the best and free online HTML editors from the next link.
The above article may contain affiliate links which help support Guiding Tech. However, it does not affect our editorial integrity. The content remains unbiased and authentic.