Public: Methods to manage the columns of an AsciiDoc table. In particular, it keeps track of the column specs
Public: Get/Set the Symbol style for this column.
# File lib/asciidoctor/table.rb, line 139 def initialize(table, index, attributes = {}) super(table, :column) @style = attributes['style'] attributes['colnumber'] = index + 1 attributes['width'] ||= 1 attributes['halign'] ||= 'left' attributes['valign'] ||= 'top' update_attributes(attributes) end
Internal: Calculate and assign the widths (percentage and absolute) for this column
This method assigns the colpcwidth and colabswidth attributes.
returns nothing
# File lib/asciidoctor/table.rb, line 157 def assign_width(total_width, even_width) if total_width > 0 width = ((@attributes['width'].to_f / total_width) * 100).floor else width = even_width end @attributes['colpcwidth'] = width if parent.attributes.has_key? 'tableabswidth' @attributes['colabswidth'] = ((width.to_f / 100) * parent.attributes['tableabswidth']).round end nil end