from xlrd import open_workbook
from docx import Document
from docx.shared import Pt
from docx.shared import RGBColor
document = Document('demo1.docx')
document.styles['Normal'].font.color.rgb = RGBColor(255,0,255) #chang color
document.tables[0].add_row()
document.tables[0].add_row()
document.tables[0].add_row()
document.tables[1].add_row()
document.tables[1].add_row()
document.tables[1].add_row()
document.tables[0].rows[3].cells[1].text = "No1"
document.tables[0].rows[4].cells[2].text = "No2"
document.tables[1].rows[3].cells[1].text = "No3"
document.tables[1].rows[4].cells[2].text = "No4"
document.save('result.docx')
The above code is not only making tables[0].rows[4].cells[2] and tables[1].rows[3].cells[1] pink, it is making the entire document to Pink(screenshot_1). How can I set only the "tables[0].rows[4].cells2" and "tables1.rows[3].cells1" text pink(screenshot_2)?
screenshot_1
screenshot_2