Pptxgenjs: Table-to-Slides default for un-styled tables is black text on black bkgd

Created on 15 Mar 2017  路  8Comments  路  Source: gitbrent/PptxGenJS

I implemented table to slides but each time a black band appears. Can you please help? Or assist me where am i going wrong?

Presentation (1).pptx

Name Test Company
<input type="button" value="Export to PPTX"
       onclick="{ var pptx = new PptxGenJS(); pptx.addSlidesForTable('mytable'); pptx.save(); }">
bug

All 8 comments

Hi @orpitadutta ,

Could you please attach a screencap instead and provide the code you're using?

Thanks.

image




DEMO






<table id="mytable">
    <thead>
        <tr>
            <th>Name</th>
            <th>Test</th>
            <th>Company</th>
        </tr>
    </thead>
</table>
<input type="button" value="Export to PPTX"
       onclick="{ var pptx = new PptxGenJS(); pptx.addSlidesForTable('mytable'); pptx.save(); }">


Hi @orpitadutta ,

I think, you need to apply some styles for the table. Currently table - background color is black & also text color is black. So you are seeing black box. @gitbrent Please correct me if i am wrong.

Ex:

Name Test Company

@orpitadutta Please try it

@alagarrk Thanks a lot, It worked but i am unable to change the background of table. Can u please help?

I tried this:











Name Test Company

<input type="button" value="Export to PPTX" onclick="fnppt()">

@orpitadutta , For addSlidesForTable() - Reproduces an HTML table - background colors, borders, fonts, padding, etc.

So you can add styles using css. For Ex:

mytable {

    background: #f2f2f2;
    border: 1px solid black;
    color: black;
}

#mytable th,
#mytable tr {
    background: #f2f2f2;
}

Please check this

@alagarrk Thnxx a lot it worked like a charm..

Hi @orpitadutta @alagarrk ,

Thanks for your help on this Issue.

Turns out that the default color returned by jQuery is black, so in un-styled tables, you end up with black text on a black background...

I've updated the code to detect this condition and default to a white background instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

readeral picture readeral  路  5Comments

sangramjagtap picture sangramjagtap  路  6Comments

DSheffield picture DSheffield  路  3Comments

colmben picture colmben  路  6Comments

simonjcarr picture simonjcarr  路  6Comments