Renders an HTML table.
- Namespace
- Statiq
.Web .Shortcodes - Interfaces
- Base Types
-
- object
- SyncShortcode
graph BT
Type-->Base0["SyncShortcode"]
click Base0 "/api/Statiq.Common/SyncShortcode"
Base0-->Base1["object"]
Type-.->Interface0["IShortcode"]
click Interface0 "/api/Statiq.Common/IShortcode"
Type["TableShortcode"]
class Type type-node
Syntax
public class TableShortcode : SyncShortcode, IShortcode
Examples
Example usage:
<?# Table Class=table HeaderRows=1 ?>
<?*
Vehicle "Number Of Wheels"
Bike 2
Car 4
Truck "A Whole Lot"
?>
<?#/ Table ?>
Example output:
<table class="table">
<thead>
<tr>
<th>Vehicle</th>
<th>Number Of Wheels</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bike</td>
<td>2</td>
</tr>
<tr>
<td>Car</td>
<td>4</td>
</tr>
<tr>
<td>Truck</td>
<td>A Whole Lot</td>
</tr>
</tbody>
</table>
Remarks
The content of the shortcode contains the table with each row on a new line and each
column separated by new lines. Enclose columns in quotes if they contain a space.
Note that since the content of a shortcode may get processed by template engines like
Markdown and the content of this shortcode should not be, you probably want to wrap
the shortcode content in the special XML processing instruction that will get trimmed
like
<?* ... ?>
so it "passes through" any template engines (see example below).
Methods
Name | Return Value | Summary |
---|---|---|
Execute |
ShortcodeResult |