Results 1 to 1 of 1
  1. #1
    3 Star Lounger
    Join Date
    Jun 2003
    Location
    Utah, USA
    Posts
    355
    Thanks
    8
    Thanked 1 Time in 1 Post

    Format/Strategies for HTML Output

    I output from a spreadsheet to HTML. I format my cells with a custom format (like ?0.0) so that the "ones digits" and "tens digtis" line up when I center the column. When Excel outputs this to HTML, it uses <span> to make this work. I'm happy with how it looks in a browser. I have attached the HTML file that shows this (although it is in TXT format since HTML uploads are not supported).

    Now my employer has switched to a Content Management System (CMS). This does not seem to support this method well: the digits line up in Excel, they line up in a browser, but when the same file is run through the CMS and one connects to its output through a browser ... they don't line up.

    The CMS people say this is because Excel is not outputting in UTF-8. (I think this is kind of ridiculous).

    Anyway, does anyone have any strategy hints for this?

    At the bottom, I've pasted Excel's HTML output. The lining up problem that Excel is solving with <span> is shown in the 6th row. Excel inserts <span style='mso-spacerun:yes'> </span> so that the decimal in the 0.0 that follows will line up with the decimal in 28.7 in the 26th row, even though the 0.0 shows less characters than the 28.7.

    BTW: I can output from Excel to PDF, which looks fine in the CMS. But PDF doesn't like the wide pages I'm outputting, and it splits them onto separate pages. This creates a whole different presentation problem for me that I'll post in a different thread. So, right now, this isn't really a viable option.

    <tr height=20 style='height:15.0pt'>
    <td height=20 class=xl651178 style='height:15.0pt'>&nbsp;</td>
    <td class=xl771178>Deegan04</td>
    <td class=xl671178></td>
    <td class=xl901178>13</td>
    <td class=xl921178><span style='mso-spacerun:yes'>*</span>0.0</td>
    <td class=xl901178>13</td>
    <td class=xl651178>&nbsp;</td>
    </tr>
    <tr height=20 style='height:15.0pt'>
    <td height=20 class=xl651178 style='height:15.0pt;font-size:12.0pt;
    color:windowtext;font-weight:400;text-decoration:none;text-underline-style:
    none;text-line-through:none;font-family:Arial;background:#B7DEE8;mso-pattern:
    black none'>&nbsp;</td>
    <td class=xl771178 style='font-size:12.0pt;color:windowtext;font-weight:400;
    text-decoration:none;text-underline-style:none;text-line-through:none;
    font-family:Arial;background:#B7DEE8;mso-pattern:black none'>7592</td>
    <td class=xl671178 style='font-size:12.0pt;color:windowtext;font-weight:400;
    text-decoration:none;text-underline-style:none;text-line-through:none;
    font-family:Arial;background:#B7DEE8;mso-pattern:black none'></td>
    <td class=xl901178 style='font-size:12.0pt;color:windowtext;font-weight:400;
    text-decoration:none;text-underline-style:none;text-line-through:none;
    font-family:Arial;background:#B7DEE8;mso-pattern:black none'>39</td>
    <td class=xl921178 style='font-size:12.0pt;color:windowtext;font-weight:400;
    text-decoration:none;text-underline-style:none;text-line-through:none;
    font-family:Arial;background:#B7DEE8;mso-pattern:black none'>28.7</td>
    <td class=xl901178 style='font-size:12.0pt;color:windowtext;font-weight:400;
    text-decoration:none;text-underline-style:none;text-line-through:none;
    font-family:Arial;background:#B7DEE8;mso-pattern:black none'>10</td>
    <td class=xl651178 style='font-size:12.0pt;color:windowtext;font-weight:400;
    text-decoration:none;text-underline-style:none;text-line-through:none;
    font-family:Arial;background:#B7DEE8;mso-pattern:black none'>&nbsp;</td>
    </tr>
    Attached Files Attached Files

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •