We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See example below - grammar doesn't have any TABLEOOONS elements leading to error setting an attribute. setAttrNS can be used as a workaround.
grammar
TABLEOOONS
setAttrNS
from odf.opendocument import OpenDocumentSpreadsheet from odf.style import Style, TableProperties from odf.table import Table import odf.namespaces as odf_ns doc = OpenDocumentSpreadsheet() style = Style(name="bb", family="table") style.addElement(props := TableProperties(display=True)) # AttributeError: Attribute tabcolor is not allowed in <style:table-properties> # props.setAttribute("tabcolor", "#ff0000") props.setAttrNS(odf_ns.TABLEOOONS, "tab-color", "#ff0000") doc.automaticstyles.addElement(style) table = Table(name="Tab 1") table.setAttribute("stylename", "bb") doc.spreadsheet.addElement(table) output_path = r"new__.ods" doc.save(output_path, False)
Patching grammar this way also helps:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
See example below -
grammar
doesn't have anyTABLEOOONS
elements leading to error setting an attribute.setAttrNS
can be used as a workaround.Patching grammar this way also helps:
The text was updated successfully, but these errors were encountered: