Method: Formatter::HTML#build_table_header
- Defined in:
- app/formatters/html_formatter.rb
#build_table_header ⇒ Object
Generates table headers based on the column names of your Data::Table.
This method does not do anything if options.show_table_headers is false or the Data::Table has no column names.
20 21 22 23 24 25 26 27 |
# File 'app/formatters/html_formatter.rb', line 20 def build_table_header output << "\t<table>\n" unless data.column_names.empty? || !.show_table_headers output << "\t\t<tr>\n\t\t\t<th>" + safe_join(data.column_names, "</th>\n\t\t\t<th>") + "</th>\n\t\t</tr>\n" end end |