Skip to content

Commit

Permalink
Add table example with image cell.
Browse files Browse the repository at this point in the history
  • Loading branch information
isamu committed Dec 21, 2023
1 parent cb9804e commit 751be9c
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion examples/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,61 @@ var docDefinition = {
],
],
},
}
},
{ text: 'Image on table', pageBreak: 'before', style: 'subheader' },
{
style: 'tableExample',
color: '#444',
table: {
widths: [200, 'auto', 'auto'],
headerRows: 2,
// keepWithHeaderRows: 1,
body: [
[
{
text: 'Header with Colspan = 3',
style: 'tableHeader',
colSpan: 3,
borderColor: ['#ff00ff', '#00ffff', '#ff00ff', '#00ffff'],
alignment: 'center',
},
{},
{},
],
[
{
text: 'Header 1',
style: 'tableHeader',
alignment: 'center',
},
{
text: 'Header 2',
style: 'tableHeader',
alignment: 'center',
},
{
text: 'Header 3',
style: 'tableHeader',
alignment: 'center',
},
],
[
{
image: 'fonts/sampleImage.jpg',
cover: {width: 100, height: 100 },
},
{
image: 'fonts/sampleImage.jpg',
cover: {width: 100, height: 100 },
},
{
image: 'fonts/sampleImage.jpg',
cover: {width: 100, height: 100 },
},
],
],
},
},
],
styles: {
header: {
Expand Down

0 comments on commit 751be9c

Please sign in to comment.