Key Value Table Formatter
Categories
Component ID
2718125
Component name
Key Value Table Formatter
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Component created
Component changed
Component body
This display formatter allows you to enter content in a textbox in a "key:value" format and have it displayed as a table row.
Based on the Definition List Formatter module by Ben McClure
Example Use Case:
You import a list of items in the following format: "Trees:green|Clouds:white|Sky:blue|Roses:red" and store it as a multiple-value text field:
Trees:green
Clouds:white
Sky:blue
Roses:red
Using this formatter in your display would output the content as a table:
<div class="kv_table">
<table>
<tbody>
<tr><td>Trees</td><td>green</td></tr>
<tr><td>Clouds</td><td>white</td></tr>
<tr><td>Sky</td><td>blue</td></tr>
<tr><td>Roses</td><td>red</td></tr>
</tbody>
</table>
</div>
