Method: FFaker::HTMLIpsum#table

Defined in:
lib/ffaker/html_ipsum.rb

#table(rows = 3) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/ffaker/html_ipsum.rb', line 74

def table(rows = 3)
  (:table) do |table|
    table << (:thead) do |thead|
      thead << (:tr) do |tr|
        tr << (:th, word.capitalize)
        tr << (:th, word.capitalize)
        tr << (:th, word.capitalize)
        tr << (:th, word.capitalize)
      end
    end
    table << (:tbody) do |tbody|
      rows.times do
        tbody << (:tr) do |tr|
          tr << (:td, words(1).capitalize)
          tr << (:td, words(1).capitalize)
          tr << (:td, words(1).capitalize)
          tr << (:td, a)
        end
      end
    end
  end
end