Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

add border to table in python pptx


from pptx.oxml.xmlchemy import OxmlElement

def SubElement(parent, tagname, **kwargs):
        element = OxmlElement(tagname)
        element.attrib.update(kwargs)
        parent.append(element)
        return element

def _set_cell_border(cell, border_color="000000", border_width='12700'):
    tc = cell._tc
    tcPr = tc.get_or_add_tcPr()
    for lines in ['a:lnL','a:lnR','a:lnT','a:lnB']:
        ln = SubElement(tcPr, lines, w=border_width, cap='flat', cmpd='sng', algn='ctr')
        solidFill = SubElement(ln, 'a:solidFill')
        srgbClr = SubElement(solidFill, 'a:srgbClr', val=border_color)
        prstDash = SubElement(ln, 'a:prstDash', val='solid')
        round_ = SubElement(ln, 'a:round')
        headEnd = SubElement(ln, 'a:headEnd', type='none', w='med', len='med')
        tailEnd = SubElement(ln, 'a:tailEnd', type='none', w='med', len='med')

Comment

add border to table in python pptx

from pptx.dml.color import RGBColor

# cell is a table cell
# set fill type to solid color first
cell.fill.solid()

# set foreground (fill) color to a specific RGB color
cell.fill.fore_color.rgb = RGBColor(0xFB, 0x8F, 0x00)
Comment

PREVIOUS NEXT
Code Example
Python :: traduce query model 
Python :: how to give values to all users with discord api python grepper 
Python :: turtle opacity 
Python :: endgame 
Python :: how to use self.list.setCurrentRow() in pyqt5 
Python :: bassie en adriaan 
Python :: iniciar un projecto de python con pyenv 
Python :: keylogger to exe 
Python :: max(X_train, key=len).split() 
Python :: ftplib tqdm 
Python :: Highlighting the shortest path in a Networkx graph 
Python :: how to navigate to a sub html script selenium python 
Shell :: remove phpmyadmin from ubuntu 
Shell :: stop nginx ubuntu 
Shell :: how to upgrade pip 
Shell :: docker install nano 
Shell :: installing zoom on ubuntu 20.04 
Shell :: upgrade pandas version 
Shell :: git list user and email 
Shell :: ubuntu apt-get update without input 
Shell :: error: failed to synchronize all databases (invalid or corrupted database (PGP signature)) 
Shell :: conda install sklearn 
Shell :: write a bash program to print a given number in reverse order 
Shell :: ls file size 
Shell :: linux install ping 
Shell :: git apply .gitignore 
Shell :: ubuntu clear dns cache 
Shell :: git rename master to main 
Shell :: @mui/lab install 
Shell :: install gd extension php ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =