Mac Tips: Convert a Numbers Table to HTML
Wanna tip? Don’t pet a burning dog. Wanna Mac tip? Here is a two-fer for ya! A pair of quick and easy ways to convert a Numbers table into HTML, both are free and did I mention easy?
The first thing to remember is that heavily formatted tables won’t convert well — simple is better. For example, cell, row and column specific text size, justification and other settings will likely get lost in the conversion.
Additionally, you will might need to hand tweak the HTML code to get the look you want.
Numbers Table to HTML: TextEdit
In Numbers, copy the contiguous cells you want to convert to HTML. Paste into a blank TextEdit document.
Next, press Command + S (File > Save) and then, as shown above, choose Web Page (.html) from File Format drop down menu.
And, as you can see in this side by side comparison — Safari on the left, TextEdit on the right) — the output is very true to the original, including funky superscript characters.
Numbers Table to HTML: AppleScript
Just download the script and save it to ~/Library/Scripts/Applications/Numbers/ (see also How to: Make Library visible in OS X 10.8). If your Library folder doesn’t have the Applications/Numbers directories, you can either manually add them or just save the script anywhere inside Scripts.
Mac Tip: Be sure to add AppleScript to your menubar (Utilities > AppleScript Editor > Preferences > click “Show script menu in menu bar”).
Now, with the script successfully installed and the table you want to export to HTML on top, run the Number to Table HTML script from the menu bar. The script will prompt you to make some adjustments (leave them blank if you don’t understand).
The output is automagically copied to the clipboard > just paste it into your HTML document (i.e. WordPress, TextEdit, etc). You may find that formulas and other hidden formatting in the resulting HTML code is visible when viewed in Safari.
You can clean that up by pasting the code into TextEdit and performing a Find & Replace.
Share your Mac tips and AppleScript secrets in the comments below…
Table data: US EPA Top 30 Tech & Telecom Green Power Users