table(id=@id class=['tableblock',"frame-#{attr :frame, 'all'}","grid-#{attr :grid, 'all'}",role] style=[("width:#{attr :tablepcwidth}%" unless option? 'autowidth'),("float:#{attr :float}" if attr? :float)].compact.join('; ')) - if title? caption.title=captioned_title - unless (attr :rowcount).zero? colgroup - if option? 'autowidth' - @columns.each do col - else - @columns.each do |col| col style="width:#{col.attr :colpcwidth}%" - [:head, :foot, :body].select {|tblsec| !@rows[tblsec].empty? }.each do |tblsec| / not sure about this one, done when converting to a compilable slim template - @rows[tblsec].each do |row| tr - row.each do |cell| / store reference of content in advance to resolve attribute assignments in cells - if tblsec == :head - cell_content = cell.text - else - case cell.style - when :literal - cell_content = cell.text - else - cell_content = cell.content = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td', :class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"], :colspan=>cell.colspan, :rowspan=>cell.rowspan, :style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil)) - if tblsec == :head =cell_content - else - case cell.style - when :asciidoc div=cell_content - when :literal .literal: pre=cell_content - when :header - cell_content.each do |text| p.tableblock.header=text - else - cell_content.each do |text| p.tableblock=text