Create the table in Calc, copy and paste special (Ctrl+Shift+V
) as LibreOffice Spreadsheet (OLE object).
For more details, see my answer at 7.0 Calc - Split a cell Diagonally and write text in each parts horizontal aligned left and right - SOLVED.
Tested with LibreOffice 7.0.6.2 (x64); OS: Windows 10.0.
Add Answer is reserved for solutions. If you think the answer is not satisfactory, add a comment below, or click edit (below your question) to add more information. Thanks.
I thought that the diagonal was added in the not too distant past but I didn’t see it. I forgot it was for Calc. Cheers, Al
Thank you so much! It must be better if LibreOffice has a line drawing tool for the table. Just as Microsoft Office Word.
If you don’t want to be constrained to setting a column width or height there is another way, possibly slightly less appealing visually.
Draw a line on the page at 45 degrees, about 50mm x 50mm, default width but change colour to black (or to match border colour). With it selected click File > Export, name it something like DiagonalLine.gif and save it, when it asks for a resolution choose something reasonably high, like 300 dpi. You can delete the line now.
Right-click cell A1 in your table (or whichever cell you want the line to be in) and select Table Properties. In the dialog box that opens select tab Background, click the button Bitmap then click the button Add/Import. Navigate to your DiagonalLine.gif and OK. Change the style from Tiled to Stretched, click OK.
You can change height or width of cell and diagonal remains the diagonal. If you make the cell too big the line will begin to look too chunky.
You will get a better looking line, exporting a selected diagonal line from Draw, as SVG. The vantage is that line size adapt automatically when changing cell size.
GIF or PNG are not good here.
You’re absolutely right. I took the word Bitmap at face value and did not consider svg, maybe it should be labelled Image. In retrospect the pattern fills elsewhere are vectors so it can obviously handle them.
It still suffers from the width scaling so your solution is the correct one