How to Convert an Excel Sheet or Cells to an HTML Table?


Have you ever faced a situation where you needed to create an HTML table for a range of cells or a whole worksheet? Developers in webpages use HTML tables to arrange data in tables. In this article, we'll look at how to convert an Excel sheet or cell into an HTML table. This procedure can be completed using one of two methods: the first is to use "save as," and the second is to use the formulas.

Converting a Sheet or Cells to an HTML Table Using "Save As"

Here, we'll resave the sheet with the save as command and then change the format to Excel. Let's go over a simple procedure for converting a sheet or cells to an HTML table in Excel using Save As.

Step 1

Let us consider any Excel table that you want to convert into an HTML table.

Then click on file, click on save as, and select Browse, as shown in the following screenshot.

File > Save as > Browse

Step 2

Then, in the pop-up window, select the web page from the list.

Step 3

Then click on the selected sheet or whole workbook, click on save to open the publish page, then click on change, type your title, click OK, and click on publish to complete our proces

Converting a Sheet or Cells to HTML Table Using Formulas

Here we will add the HTML tags into the sheet and then use the & operator to join the cells. Let's go over a simple procedure for converting sheets or cells to an HTML table using formulas.

Step 1

Let us consider the same data that we used in the above example, as shown in the below image.

Now click on the cell C1 and enter the data in the sheet as shown in the below image.

Step 2

Then click on the empty cell (in our case, cell G1) and enter the formula as, "=C1&D1&A1&E1&D1&B1&E1&F1"and press the Enter button.

Then drag‑down using the auto-fill handle to fill all the cells.

Step 3

Select the new values and copy them using the keyboard shortcuts CTRL + C. Now click on an empty cell, click on "Paste," and then select "Paste as values."

Step 4

Finally, add <table><tbody> at the top of values and </tbody></table> at the bottom of values to complete our HTML table, as shown in the following screenshot.

Conclusion

In this tutorial, we used a simple example to demonstrate how you convert an Excel sheet or cells to an HTML table in Excel.

Updated on: 08-Feb-2023

973 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements