Open Kituva opened 8 months ago
Hi @Kituva. (I see you've moved this over from Stack Overflow.)
There I suggested using a fixed pitch font but I think I have a better idea: You could do it by making each column a separate cell. The issue you will find is how to delete the vertical lines between cells.
Sorry to advertise my md2pptx Open Source project but scan the file md2pptx
for function applyCellBorderStyling
. It's where I've extended what python-pptx does to apply styling to the sides of a table cell.
That function should help you solve the "deleting cell lines" problem.
The other problem will be merging cells for the titles. python-pptx can already do that (I think).
Note: I don't think md2pptx solves your problem itself.
Hi @MartinPacker, Thanks for your input, However, I would like the tickers in a cell to be arranged side by side (Parallelly) and dynamically adjust the width of the columns to accommodate the tickers. For example, you can refer to the Basic Materials cell for bottom fishing in the image below.
Right. Cells with invisible boundaries are the way to do that. And "Bottom Fishing" would be spanning more than one cell (column).
Unless, that is, you want cells to flow - so that CGAU through to VALE are one item.
Actually, there are no cells without boundaries. In the image, it looks like it doesn't have boundaries, but when you zoom in on the PowerPoint, the boundary lines become visible.
My point is - with the function I pointed to - you can control the boundary lines, including turning them off - selectively for each side of the cell.
I am working on a Python script that generates a PowerPoint presentation with a table containing tickers. I am using the python-pptx library for this task. However, I am facing an issue in arranging the tickers side-by-side within each cell of the table.
I have a dictionary (segregated_data) containing sectors and their respective rankings, where each combination has a list of tickers. The tickers are currently displayed in a column within each cell, but I want them to be arranged side-by-side.
I've attempted to modify paragraph alignment and utilize line breaks ("\n"), but I haven't achieved the desired side-by-side arrangement yet. Additionally, the output is currently overflowing the PowerPoint slide. I aim to make it dynamically adjust within the PowerPoint slide area. Below, you'll find screenshots of the current and desired output, and I've also attached the Excel file to help you replicate the issue locally.
Current Output
Desired Output
Excel file WHG Testing.xlsx
Any guidance on how to modify the code to arrange tickers side-by-side within each table cell would be greatly appreciated. Thank you!