How to merge cells using Ruby Spreadsheet gem. I would like to combine the first 6 cells in the first row of the sheet. When I try the following, it will not work:
merge_format = Spreadsheet::Format.new :align => :merge 6.times do |j| sheet.row(0).set_format(j,merge_format) end
What am I doing wrong?
You can just do
sheet.merge_cells(start_row, start_col, end_row, end_col)
If you want to go with set_format , I would advise you to try :vertical_align => :merge , although I did not use it, since merge_cells always worked for me.
set_format
:vertical_align => :merge
merge_cells
Source: https://habr.com/ru/post/921085/More articles:OpenGL 3.2 w / NSOpenGLView - objective-cHow to read InputStream with UTF-8? - javaWhat does it mean to say that the "Linux kernel is proactive"? - linuxHow the kernel may not be proactive and still have several control paths - linux-kernelProblems parsing Spanish characters (á, é, í, ó, ú) from an XML response - javajqplot show marker on one diagram - javascriptjqplot Highlighter for different line graphs - javascriptUsing tor proxies with scrapy - pythonCannot connect ASP.NET database to SQL Server Management Studio - asp.netJava file extension without substring - javaAll Articles