[[PageOutline(2-5,Contents,pullout)]] = Display a table with the markup from data entered in a flat form == Description This [WikiProcessors Wiki processor] allows you to enter the data for a table in an alternative markup, which is very useful when there are a lot of columns and/or when some of the columns are optional. This markup also has the advantage of being much more readable and diff-friendly, at the expense of requiring more markup. The column definition for the table has to be specified immediately after the macro directive: {{{ {{{ #!flat-table #! Name: key, Relation: relation, Comment: comment notes [... table data ...] }}} }}} Alternatively, one can also create a macro alias via configuration in your `trac.ini` file: {{{#!ini [flat-table] dbdoc = Name: key, Relation: relation, Comment: comment notes dbdoc.description = macro description goes here }}} For the above example, one can then directly use the following: {{{ {{{ #!dbdoc [... table data ...] }}} }}} See also: TablePlugin. === Markup The markup is loosely based on a very simplified YAML/JSON-like syntax. At least one column is always assumed to be mandatory per table, which is the '''key''' column. The order and name of the generated columns is controlled by the metadata line, as shown above. For each column, one can define one or more '''aliases''' which can be used in the markup to define the column data. A line with no leading spaces and ending in a colon defines the start of a new row, with the line content representing the value of the '''key''' column. A line with some leading spaces followed by an '''@alias:''' defines the column within the row. Any other content on that line or any subsequent lines is assumed to be the content of that column (basic Wiki syntax can be used). === Example {{{ {{{ #!flat-table #! Name: key, Relation: relation, Comment: comment notes id: @relation: PK desc: @comment: description other_table_id: @relation: FK to other table @notes: This is a reference to another table with a [WikiPedia:Wiki wiki] link. More than one line can be entered for a column. }}} }}} will result in a display like this || '''Name''' || '''Relation''' || '''Comment''' || || id || PK || || || desc || || description || || other_table_id || FK to other table || This is a reference to another table with a [WikiPedia:Wiki wiki] link. [[BR]]More than one line can be entered for a column.|| == Bugs/Feature Requests Existing bugs and feature requests for FlatTableMacro are [report:9?COMPONENT=FlatTableMacro here]. If you have any issues, create a [/newticket?component=FlatTableMacro new ticket]. [[TicketQuery(component=FlatTableMacro&group=type,format=progress)]] == Download Download the zipped source from [export:flattablemacro here]. == Source You can check out FlatTableMacro from [/svn/flattablemacro here] using Subversion, or [source:flattablemacro browse the source] with Trac. == Installation General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. == Recent Changes [[ChangeLog(flattablemacro, 3)]] == Author/Contributors '''Author:''' [wiki:ashkulz] [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:'''