Excel Document Basics

How to make an Excel document using HTML tables

James Paden avatar
Written by James Paden
Updated over a week ago

To make an Excel file with DocRaptor, your document content should only contain tables. Here is example input of a basic, single worksheet file.

Use CSS to style cells, rows, and the entire table using inline style attributes:

<table name="Example Worksheet">
  <tr style="font-size: 16px">
    <td colspan="2">Big Row</td>
  </tr>
  <tr>
    <td style="color: blue">Blue Cell</td>
    <td style="-xls-format:currency_dollar">1000</td>
  </tr>
</table>

Note: DocRaptor doesn't support writing CSS <style> blocks. You must use inline styles.

Multiple Worksheets

To make an XLS file with more than one worksheet, just send multiple tables, wrapped in a <tables> tag. With the following input:

<tables>
  <table name="Dino Scale">
    ...
  </table>
  <table name="Dino Budget">
    ...
  </table>
</tables>

This will be your output:

Did this answer your question?