@texnixe i am editing your spreadsheet plugin a little to generate a bespoke table. Ive done this by copying your kirby tag in the plugin and using it as a starting point. Ive got classes on alternate TD’s working but my last hurdle is to add alternate classes to the TR tags inside the tbody. heres what ive got… can you give me a hint please? I think the answer similar to what i have but im not sure how to make it work with the $btr = new Brick('tr'); part
Check if the cell is empty and only add a cell if not (and add the colspan attribute)
As regards the formatting, I don’t know. What does it do with the bulleted list? I don’t think that the Spreadsheet Reader supports anything more fancy than numbers and dates, but you can check the source code.
Sometimes i can be a little stupid It’s been a busy morning.
Actually i think PHP reader can do this. I used to use Textpattern, and there was a very similar plugin for that using the same reader that you used for your plugin. It was clever enough to merge cells and add the rowspans and colspans accordingly. if i remember rightly it could even pull in cell colors and border styles as set in the spreadsheet.
I have a copy of this old plugins souce code for Textpattern, but I wouldnt know where to begin to port this over to Kirby.
It’s based on the same code. vendor/php-excel-reader/excel_reader2.php in your plugin is the same library for reading the excel file that is in the Textpattern plugin. Looks like they built extensions on top to handle a couple more file formats then the original reader did.
I see. I might have a crack at this over christmas lull to see if I can build on your excellent effort and add the auto merging of cells and automatic odd / even classes on demand. Will keep me out of trouble.
Of course, and this is the best way, but there are some cranky old browsers and some devices that have issues with certain uses of nth-child. Personally I don’t support old browsers, but that doesn’t mean that someone using the plugin won’t have to. I won’t render the classes by default.