{ "component": "table", "fixtures": [ { "name": "default", "options": { "rows": [ [ { "text": "January" }, { "text": "£85", "format": "numeric" }, { "text": "£95", "format": "numeric" } ], [ { "text": "February" }, { "text": "£75", "format": "numeric" }, { "text": "£55", "format": "numeric" } ], [ { "text": "March" }, { "text": "£165", "format": "numeric" }, { "text": "£125", "format": "numeric" } ] ] }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
January£85£95
February£75£55
March£165£125
" }, { "name": "table with head", "options": { "head": [ { "text": "Month you apply" }, { "text": "Rate for bicycles", "format": "numeric" }, { "text": "Rate for vehicles", "format": "numeric" } ], "rows": [ [ { "text": "January" }, { "text": "£85", "format": "numeric" }, { "text": "£95", "format": "numeric" } ], [ { "text": "February" }, { "text": "£75", "format": "numeric" }, { "text": "£55", "format": "numeric" } ], [ { "text": "March" }, { "text": "£165", "format": "numeric" }, { "text": "£125", "format": "numeric" } ] ] }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Month you applyRate for bicyclesRate for vehicles
January£85£95
February£75£55
March£165£125
" }, { "name": "table with head and caption", "options": { "caption": "Caption 1: Months and rates", "captionClasses": "govuk-table__caption--m", "firstCellIsHeader": true, "head": [ { "text": "Month you apply" }, { "text": "Rate for bicycles", "format": "numeric" }, { "text": "Rate for vehicles", "format": "numeric" } ], "rows": [ [ { "text": "January" }, { "text": "£85", "format": "numeric" }, { "text": "£95", "format": "numeric" } ], [ { "text": "February" }, { "text": "£75", "format": "numeric" }, { "text": "£55", "format": "numeric" } ], [ { "text": "March" }, { "text": "£165", "format": "numeric" }, { "text": "£125", "format": "numeric" } ] ] }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Caption 1: Months and rates
Month you applyRate for bicyclesRate for vehicles
January£85£95
February£75£55
March£165£125
" }, { "name": "with small text modifier for tables with a lot of data", "options": { "classes": "govuk-table--small-text-until-tablet", "rows": [ [ { "text": "January" }, { "text": "£85", "format": "numeric" }, { "text": "£95", "format": "numeric" } ], [ { "text": "February" }, { "text": "£75", "format": "numeric" }, { "text": "£55", "format": "numeric" } ], [ { "text": "March" }, { "text": "£165", "format": "numeric" }, { "text": "£125", "format": "numeric" } ] ] }, "hidden": false, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
January£85£95
February£75£55
March£165£125
" }, { "name": "classes", "options": { "classes": "custom-class-goes-here", "rows": [ [ { "text": "Jan" }, { "text": "Feb" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n
JanFeb
" }, { "name": "attributes", "options": { "attributes": { "data-foo": "bar" }, "rows": [ [ { "text": "Jan" }, { "text": "Feb" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n
JanFeb
" }, { "name": "html as text", "options": { "head": [ { "text": "Foo " } ], "rows": [ [ { "text": "Foo " } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n
Foo <script>hacking.do(1337)</script>
Foo <script>hacking.do(1337)</script>
" }, { "name": "html", "options": { "head": [ { "html": "Foo bar" } ], "rows": [ [ { "html": "Foo bar" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n
Foo bar
Foo bar
" }, { "name": "head with classes", "options": { "head": [ { "text": "Foo", "classes": "my-custom-class" } ], "rows": [ [ { "text": "Jan" }, { "text": "Feb" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n \n
Foo
JanFeb
" }, { "name": "head with rowspan and colspan", "options": { "head": [ { "text": "Foo", "rowspan": 2, "colspan": 2 } ], "rows": [ [ { "text": "Jan" }, { "text": "Feb" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n \n
Foo
JanFeb
" }, { "name": "head with attributes", "options": { "head": [ { "text": "Foo", "attributes": { "data-fizz": "buzz" } } ], "rows": [ [ { "text": "Jan" }, { "text": "Feb" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n \n
Foo
JanFeb
" }, { "name": "with firstCellIsHeader true", "options": { "firstCellIsHeader": true, "rows": [ [ { "text": "January" }, { "text": "£85", "format": "numeric" }, { "text": "£95", "format": "numeric" } ], [ { "text": "February" }, { "text": "£75", "format": "numeric" }, { "text": "£55", "format": "numeric" } ], [ { "text": "March" }, { "text": "£165", "format": "numeric" }, { "text": "£125", "format": "numeric" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
January£85£95
February£75£55
March£165£125
" }, { "name": "firstCellIsHeader with classes", "options": { "firstCellIsHeader": true, "rows": [ [ { "text": "Foo", "classes": "my-custom-class" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n
Foo
" }, { "name": "firstCellIsHeader with html", "options": { "firstCellIsHeader": true, "rows": [ [ { "html": "Foo bar" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n
Foo bar
" }, { "name": "firstCellIsHeader with html as text", "options": { "firstCellIsHeader": true, "rows": [ [ { "text": "Foo " } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n
Foo <script>hacking.do(1337)</script>
" }, { "name": "firstCellIsHeader with rowspan and colspan", "options": { "firstCellIsHeader": true, "rows": [ [ { "text": "Foo", "rowspan": 2, "colspan": 2 } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n
Foo
" }, { "name": "firstCellIsHeader with attributes", "options": { "firstCellIsHeader": true, "rows": [ [ { "text": "Foo", "attributes": { "data-fizz": "buzz" } } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n
Foo
" }, { "name": "with falsey items", "options": { "rows": [ [ { "text": "A" }, { "text": 1 } ], false, null, [ { "text": "B" }, { "text": 2 } ], [ { "text": "C" }, { "text": 3 } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
A1
B2
C3
" }, { "name": "rows with classes", "options": { "rows": [ [ { "text": "Foo", "classes": "my-custom-class" } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n
Foo
" }, { "name": "rows with rowspan and colspan", "options": { "rows": [ [ { "text": "Foo", "rowspan": 2, "colspan": 2 } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n
Foo
" }, { "name": "rows with attributes", "options": { "rows": [ [ { "text": "Foo", "attributes": { "data-fizz": "buzz" } } ] ] }, "hidden": true, "description": "", "previewLayoutModifiers": [], "html": "\n \n \n \n \n \n
Foo
" } ] }