I have an Excel sheet with several sheets and containing quite a few tables of information which are really intended to be published on a common wiki at my company. Previously, we used to use MediaWiki, and I had found a very good export tool that took a selection in Excel and generated a huge chunk of very readabble MediaWiki table markup. Several such tables were usually put on the same Wiki page.

Unfortunately for this approach, company changes ensued, and now the same information needs to go either into essentially bare-HTML pages or a Twiki system. Neither of which supports the dear old Mediawiki syntax.

So the question is: is there some way to export clean HTML or Twiki table syntax from an Excel table selection?

If you select "save as..." "html" "selection only" in Excel itself, you get one complete web page per table. Sure, the core table bit can be extracted from that. However, the code is pretty horrific, full of MS style things to make it look EXACTLY like in Excel, which is not in general what you want. You want the wiki engine and browser to deal with formatting that works OK on the screen someone is using.

(for some reason you cannot get an HTML code block to show up in SuperUser posts...)

link|improve this question
1  
FYI: any code/preformatted text blocks should be preceeded by 4 spaces on every line. Check out superuser.com/editing-help for more tips. – DMA57361 Aug 16 '10 at 9:20
I tried four spaces... but when what comes up is pure HTML code, it looks like the system just tried to render it rather than display it verbatim. – jakobengblom2 Aug 17 '10 at 11:28
feedback

1 Answer

I believe Excel Macro would help in this case.

But, I personally just do it by simple formula.

Example:

For example, the range B10:D20 is the range you want. Then just find a empty column (say column X:X), and write this formula in X10, and copy it down to X11:X20:

= "<tr><td>" & B10 & "</td><td>" & C10 & "</td><td>" & D10 & "</td></tr>"

Then, copy X10:X20 to notepad, and wrap it with <table> & </table>.

(Finally, Delete column X)

Advantage:

  • Simple & straight forward.
  • Comparing with using macro, you can specify the syntax each time.
link|improve this answer
Good simple idea. I would like a bit more smarts in the solution, however, to handle things like multiple-column and multiple-row spanning cells as well as cell alignment. – jakobengblom2 Aug 16 '10 at 18:05
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.