In this article, I will tell you 2 methods to convert an excel table or cells region to an Html source code.
1. How To Use Formula To Convert Excel Cells Region To Html Code.
- In this example, there are 2 columns.
- The first column saves the user name and the second column saves the user’s email address.
A B 1 Name Email 2 jerry [email protected] 3 tom [email protected] - Input the Html table elements in cells C1, D1, E1, and F1.
- Select cell range C1:F1, and then drag down the small square on the bottom right corner of the region to the last row to auto-fill the row data.
- Input the formula =C1&D1&A1&E1&D1&B1&E1&F1 in cell G1 and press Enter key, then you can find the Html table source code in cell G1.
- Autofill the other cells’ data in column G by dragging the small green square on the bottom right corner of cell G1.
- Select cell G1, press the Shift key and click cell G3 to select cells G1:G3.
- Press Ctrl + C to copy the Html source code in cells G1:G3.
- Then you can press Ctrl + V to paste the above Html source code to the Html editor.
- Below is the example excel cell data.
A B C D E F G 1 Name Email <tr> <td> </td> </tr> <tr><td>Name</td><td>Email</td></tr> 2 jerry [email protected] <tr> <td> </td> </tr> <tr><td>jerry</td><td>[email protected]</td></tr> 3 tom [email protected] <tr> <td> </td> </tr> <tr><td>tom</td><td>[email protected]</td></tr>
2. How To Convert Excel Table To Html Code Manually.
- Select the cells that you want to convert to an Html table.
- Click the File tab, then click the Save As menu item.
2.1 Convert To Html File On macOS.
- If you use Excel on macOS, then you can select the item Web Page (.htm) from the File Format drop-down list.
- Then it will display 3 radio buttons below the above list, they are Workbook, Sheet, and Selection:$A$2:$B$3.
- Click the Web Options… button to open the web options dialog window.
- You can input the web page title and keywords in the web options window.
- Click the Save button to convert the selected cells into an Html file.
2.2 Convert To Html File On Windows.
- If you use Excel on Windows, you can click the Browse item to browse a folder where you want to save the Html file.
- Select Web Page from the Save as type drop-down list.
- Input the Html file name in the File name input text box.
- If you just want to convert the selected cells, then check the radio button Selection:$A$2:$B$3.
- If you want to convert the entire workbook, you can check the radio button Entire Workbook.
- Click the Save button will open the Publish as Web Page dialog window.
- You can change the title in this window by clicking the Change… button.
- You can check the checkbox AutoRepublish every time this workbook is saved to auto-regenerate the Html file.
- You can also check the checkbox Open published web page in browser to open the Html file in a web browser after publishing it.
- Click the Publish button to generate the Html file.
- Then you can open the generated Html file to get the converted Html source code.