How to Convert an Excel Sheet to an HTML Table

Key Takeaways

  • Saving the file as a webpage is the easiest method you may try.
  • In most cases, you would need a code editor or Notepad to view the HTML for the converted table.

Method 1: Save as Webpage

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 try to convert a simple table. You can remove those extra lines if you are familiar with HTML coding.

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 the File option at the top and choose Save As. Select the folder where you want to save the generated HTML file.

File Save as option on Excel

Step 3: The Save As dialog box will open. Click on the Save as type drop-down box > choose Web page.

Save as webpage

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.

Save entire workbook

Step 5: Another pop-up window will open. Click on Publish.

Publish web page

The file will be saved as an HTML page. To view its code, follow the instructions given below.

See more:  How to Convert YouTube Videos on Android to MP3 Audio

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. If your HTML editor is installed on your PC, select it, or choose any regular text editor, such as Notepad or its alternatives.

open with NotePad

Here’s a snapshot of how the HTML code looks like using this method:

HTML snapshot

Method 2: Use HTML Editor

One of the simplest methods is to copy the cells from your Excel sheet and paste them into an HTML editor. That will automatically generate the required code for the HTML table. In this example, we use the online HTML editor.

Step 1: Open your Excel sheet. Copy the cells containing your data. Use the Ctrl + C keyboard shortcut to copy the cells.

Step 2: Open any HTML editor and paste the copied cells into the box on the left side.

HTML editor

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.

HTML table code

Method 3: Using Google Sheets Publish to Web Feature

This will entail opening the Excel file with Google Sheets. Follow the steps below.

Step 1: Open your Google Drive on a browser.

Step 2: Navigate to where you saved the Excel file on your computer and drag and drop it into any location on your Google Drive.

Step 3: Click on the File in your Drive, expand Open with, and select Google Sheets.

See more:  VLC: Get Subtitles, Resume Videos from Last Position

Open with Google sheets

Step 4: Click on File > Share > Publish to web.

Publish to web

Step 5: Click Publish, then copy the link.

Step 6: Paste the link in your browser and click Enter.

Step 7: Right-click the page > click Inspect.

Inspect page

Step 8: In the new window, expand tags till you find Table > right-click and select Copy > Copy element.

Copy table tag

Now, you may paste the HTML table code into any editor.

Was this helpful?

.happy-face-cls-1{fill:#c9c9c9;}.happy-face-cls-2{fill:#e1e1e1;}.happy-face-cls-3{fill:#676767;}

.sad-face-cls-1{fill:#c9c9c9;}.sad-face-cls-2{fill:#676767;}.sad-face-cls-3{fill:#e1e1e1;}.sad-face-cls-4{fill:#676767;}


Thanks for your feedback!

Categories: How to
Source: thpttranhungdao.edu.vn/en/

Rate this post

Leave a Comment