FinalDestiny
FinalDestiny

Reputation: 1188

HTML to EXCEL -> simple question

O have a ,,export to excel" function, I have some tables and it works fine, but I have one single problem.

For moving to the next line I use <br />, but what if I want to switch to the next column? What tag can I use to switch to the next column?

Thanks

Upvotes: 0

Views: 766

Answers (3)

23W
23W

Reputation: 1530

In all Excel versions where I used this approach no other way to go to another column, but to use the table. You can mark up your html file with a table layout (although this is not recommended by W3C), and place all of the nested data table inside the main layout table. Unfortunately no other way.


P.S.: Look at Excel html format: Saving and Opening HTML Files.

The BR tag has a mso-data-placement style attribute specifying where the data is stored. The attribute can have one of the following string constants: new-cell means to start a new cell in the next row after the break and same-cell means that the break is in a cell.

Upvotes: 1

code4life
code4life

Reputation: 15794

Simple HTML tags are supported on a limited basis by Excel. There used to be a list of supported HTML tags as well as some HTML extensions supported by Excel (from Excel 97 onwards), but I can't find it on MSDN anymore. Here's an alternate link:

http://www.code4lifesoftware.com/articles/msexcelreadme.htm

The new XML/HTML format supported from Excel 2000 onwards is a lot more complex, and requires more work:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoffxml/html/ofxml2k.asp

Take a look at these links, hopefully you'll find the syntax you're looking for!

Upvotes: 2

justkt
justkt

Reputation: 14766

If you use commas and make your file a .csv, that would be one way. If you use tabs, then have it read as a tab delimited file. Basically, you need to tell Excel what your delimiter (separator character) is, and it will handle it from there.

Upvotes: 0

Related Questions