目前我正在做这样的事情
wb = xlsx_package.workbook
wb.styles do |s|
head_cell = s.add_style :b => true, :alignment => { :horizontal=> :center }
empty_cell = s.add_style :bg_color => "808080"
wb.add_worksheet(name: "Export") do |sheet|
sheet.add_row ['Modulverantwortliche','Dozenten', 'Modultitel', 'CP', 'SWS', 'Sommer/Winter'], :style => [head_cell, head_cell, empty_cell, head_cell, head_cell, head_cell]
foo = getUserDetails()
foo.each do |l|
modul = l[:object]
turnus = ""
if modul.semester_id == 1
turnus = "s"
elsif modul.semester_id == 2
turnus = "w"
else
turnus = "s/w"
end
sheet.add_row [ modul.modultitel, modul.modulbeauftragte, modul.lehrende, modul.creditpoint, modul.sws, turnus]
end
end
现在我需要为第一列和第二列设置宽度。我怎么能这样做?