Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion about table = no border #169

Closed
eddyclock opened this issue Sep 5, 2017 · 7 comments
Closed

Suggestion about table = no border #169

eddyclock opened this issue Sep 5, 2017 · 7 comments
Assignees
Milestone

Comments

@eddyclock
Copy link

Dear PPTx Team,

Just my small input about this

if ( cellOpts.border && typeof cellOpts.border === 'string' ) { if (cellOpts.border == 'noborder'){ var intW = 0; var strClr = '<a:noFill/>'; var strAttr = '<a:prstDash val="'; strAttr += "solid"; strAttr += '"/><a:round/><a:headEnd type="none" w="med" len="med"/><a:tailEnd type="none" w="med" len="med"/>'; // *** IMPORTANT! *** LRTB order matters! (Reorder a line below to watch the borders go wonky in MS-PPT-2013!!) strXml += '<a:lnL w="'+ intW +'" cap="flat" cmpd="sng" algn="ctr">'+ strClr + strAttr +'</a:lnL>'; strXml += '<a:lnR w="'+ intW +'" cap="flat" cmpd="sng" algn="ctr">'+ strClr + strAttr +'</a:lnR>'; strXml += '<a:lnT w="'+ intW +'" cap="flat" cmpd="sng" algn="ctr">'+ strClr + strAttr +'</a:lnT>'; strXml += '<a:lnB w="'+ intW +'" cap="flat" cmpd="sng" algn="ctr">'+ strClr + strAttr +'</a:lnB>'; }else{ strXml += ' <a:lnL w="'+ ONEPT +'" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:srgbClr val="'+ cellOpts.border +'"/></a:solidFill></a:lnL>'; strXml += ' <a:lnR w="'+ ONEPT +'" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:srgbClr val="'+ cellOpts.border +'"/></a:solidFill></a:lnR>'; strXml += ' <a:lnT w="'+ ONEPT +'" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:srgbClr val="'+ cellOpts.border +'"/></a:solidFill></a:lnT>'; strXml += ' <a:lnB w="'+ ONEPT +'" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:srgbClr val="'+ cellOpts.border +'"/></a:solidFill></a:lnB>'; } }

Thanks,
Eddy Kwok

@gitbrent gitbrent self-assigned this Sep 7, 2017
@gitbrent
Copy link
Owner

gitbrent commented Sep 7, 2017

Hi @eddyclock ,

Thanks for the issue.

You can create a table without borders by passing a pt value of 0.

var pptx = new PptxGenJS();
var slide = pptx.addNewSlide();
slide.addTable( ['cell 1','cell 2'], { x:1, y:1, w:3 }, { border:{pt:0} } );
pptx.save('PptxGenJS-TableNoBorder');

I see where this is undocumented, so i'll get it added shortly!

gitbrent pushed a commit that referenced this issue Sep 7, 2017
@eddyclock
Copy link
Author

HI @gitbrent
I have tried this code before and after your post and no luck in office2010/2013/win7eng / the code for no border is <a:noFill/>.
Just my small input.
Eddy Kwok

@gitbrent gitbrent added this to the 1.8.0 milestone Sep 7, 2017
gitbrent pushed a commit that referenced this issue Sep 7, 2017
@gitbrent
Copy link
Owner

gitbrent commented Sep 7, 2017

Ah, quite right! I've added this feature and updated the docs.

border:'none' will remove borders

PowerPoint now recognizes the table as having no borders:

screen shot 2017-09-06 at 23 58 48

@eddyclock
Copy link
Author

hi @gitbrent .
That greats and super thanks,
I really love this PptxGenJS and thanks for your genius work.
Eddy Kwok

@gitbrent
Copy link
Owner

gitbrent commented Sep 8, 2017

Thanks @eddyclock !

@gitbrent gitbrent closed this as completed Sep 8, 2017
@skgattani
Copy link

Hi,
Is it possible to give border to a cell on only one side like left side border for a specific cell?

Thanks,

@Karthikkdr
Copy link

how to use 'outside border', can anyone help me out here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants