Best Practice

If you need to convert a spreadsheet to a table for the Web, you should avoid the Save As…Web page option because the result is inaccessible and difficult to edit. See details below in the next section. The Penn State CAS Excel conversion tool allows you to copy spreadsheet data and export an accessible table. This tool is courtesy of the Penn State College of Agricultural Sciences.

Accessibility and Usability Concerns

  1. Excel cannot export a CAPTION or SUMMARY.
  2. The first row cells are not specified as headers (TH)
  3. Cells are exported with fixed widths instead of percent widths
  4. TD cell attributes are not enclosed in quotes which violates web standards
  5. Some versions of Excel export the spreadsheet as a page with the table embedded as a frame
  6. Styles are embedded in the export

Top of Page

Sample Conversion

The example below shows how an Excel spreadsheet is converted to HTML.

Sample Data

Thai Letter Entity Codes
Character Name Character Hex Entity
THAI CHARACTER KO KAI ก (Ko Kai Symbol)
THAI CHARACTER KHO KHAI ข (Symbol)
THAI CHARACTER KHO KHUAT ฃ (Symbol)
THAI CHARACTER KHO KHWAI ค (Symbol)
THAI CHARACTER KHO KHON ฅ (Symbol>
THAI CHARACTER KHO RAKHANG ฆ (Symbol)

Intended Result

<table;>
<caption>Thai Letter Entity Codes</caption>
<tbody><tr> <th scope="col">Character Name</th>
<th scope="col">Character</th>
<th scope="col">Hex&nbsp;Entity</th>
</tr>
<tr>
<td>THAI CHARACTER KO KAI</td>
<td>ก (Ko Kai Symbol)</td><td>&amp;#x0E01</td></tr>
….

</table>

Actual Result

<body link=blue vlink=purple>
<meta charset=utf-8>

<table border=0 cellpadding=0 cellspacing=0 width=490 style=’border-collapse:
collapse;table-layout:fixed;width:490pt;orphans: auto;text-align:start;
widows: auto;-webkit-text-stroke-width: 0px’>
<col width=235 style=’mso-width-source:userset;mso-width-alt:7520;width:235pt’>
<col width=85 span=3 style=’width:85pt’>
<tr height=20 style=’height:20.0pt’>
<td height=20 class=xl65 width=235 style=’height:20.0pt;width:235pt’>Character
Name</td>
<td class=xl66 width=85 style=’border-left:none;width:85pt’>Character</td>
<td class=xl66 width=85 style=’border-left:none;width:85pt’>Entity</td>
<td class=xl67 width=85 style=’border-left:none;width:85pt’>Hex&nbsp;Entity</td>
</tr>
<tr height=41 style=’height:41.0pt’>
<td height=41 class=xl68 style=’height:41.0pt;border-top:none’>THAI CHARACTER
KO KAI</td>
<td class=xl69 style=’border-top:none;border-left:none’>ก</td>
<td class=xl70 style=’border-top:none;border-left:none’>&amp;#3585;</td>
<td class=xl71 style=’border-top:none;border-left:none’>&amp;#x0E01</td>
</tr>

…</table>

 

Top of Page