Considerations when preserving the background color of the spreadsheet cells

When you are importing an Excel file you the having the option to preserve the colors of the spreadsheet cells. By “color” we mean the font color or the background color of the cell or both.

The exact meaning can be specified manually by visiting the “User Preferences” page and checking the appropriate options in the “Excel Reading Preferences” section of the page.

In the same section you can specify other preferences, such as what attributes of the font styling will be preserved during the importation.

If you have selected to preserve the colors and you have enabled the option “Background Color” in the User Preferences page, the background color of the spreadsheet cells will be imported along with the rest of the data. Nevertheless, you will still need to make some adjustments, otherwise the visual result may be different from what you would expect. There are two reasons for that:

  1. The background colors are properties of a SPAN element that contains the contents of the table cell as shown below:

    The corresponding HTML will look like this:

    <td class="tabcol"><span class="xcell" style="color: 
    #000000;background-color: #92D050;">Sample text</span></td>

    What this practically means is that you want to remove unwanted space padding between the span borders and the table cell borders. Below is the recommend CSS styling for that:

    table tr.tabrow td.tabcol {
        padding: 0px; 
    table tr.tabrow td.tabcol span.xcell {
        display: block;
        padding: 5px;

    You may also want to specify the height as shown below

    table.tabtable-rs_jqhhs9av_1 tr.tabrow td.tabcol span.xcell {
        display: block;
        height: 20px;
        white-space: nowrap;
        padding: 5px;
  2. Tabulizer will import all colors, including the black and white colors if they are specified in the source Excel file. This poses the question of how you remove unwanted black or white backgrounds. The easiest solution is with a replacement rule with the following settings

    element: table
    range: all
    Find: background-color: #000000;
    Replace with: (leave blank)

    The rule above will remove the black background (#000000) that was accidentally imported along with the other background colors.