Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
var surfaceModel = ve.init.target.getSurface().getModel(); | var surfaceModel = ve.init.target.getSurface().getModel(); | ||
surfaceModel.getFragment(). | surfaceModel.getFragment() | ||
.adjustLinearSelection( 1 ) | |||
.collapseToStart() | |||
.insertContent( [ | |||
{ type: 'table' }, | |||
{ type: 'tableCaption' }, | |||
{ type: 'paragraph' }, 'C', 'a', 'p', 't', 'i', 'o', 'n', { type: '/paragraph' }, | |||
{ type: '/tableCaption' }, | |||
{ type: 'tableSection', attributes: { style: 'body' } }, | |||
{ type: 'tableRow' }, | |||
{ type: 'tableCell', attributes: { style: 'header' } }, | |||
{ type: 'paragraph' }, 'A', { type: '/paragraph' }, | |||
{ type: '/tableCell' }, | |||
{ type: 'tableCell', attributes: { style: 'data' } }, | |||
{ type: 'paragraph' }, 'A', '1', { type: '/paragraph' }, | |||
{ type: '/tableCell' }, | |||
{ type: 'tableCell', attributes: { style: 'data' } }, | |||
{ type: 'paragraph' }, 'A', '2', { type: '/paragraph' }, | |||
{ type: '/tableCell' }, | |||
{ type: 'tableCell', attributes: { style: 'data' } }, | |||
{ type: 'paragraph' }, 'A', '3', { type: '/paragraph' }, | |||
{ type: '/tableCell' }, | |||
{ type: '/tableRow' }, | |||
{ type: 'tableRow' }, | |||
{ type: 'tableCell', attributes: { style: 'header' } }, | |||
{ type: 'paragraph' }, 'B', { type: '/paragraph' }, | |||
{ type: '/tableCell' }, | |||
{ type: 'tableCell', attributes: { style: 'data' } }, | |||
{ type: 'paragraph' }, 'B', '1', { type: '/paragraph' }, | |||
{ type: '/tableCell' }, | |||
{ type: 'tableCell', attributes: { style: 'data' } }, | |||
{ type: 'paragraph' }, 'B', '2', { type: '/paragraph' }, | |||
{ type: '/tableCell' }, | |||
{ type: 'tableCell', attributes: { style: 'data' } }, | |||
{ type: 'paragraph' }, 'B', '3', { type: '/paragraph' }, | |||
{ type: '/tableCell' }, | |||
{ type: '/tableRow' }, | |||
{ type: '/tableSection' }, | |||
{ type: '/table' } | |||
] ); |
Version vom 1. Februar 2016, 17:17 Uhr
var surfaceModel = ve.init.target.getSurface().getModel();
surfaceModel.getFragment()
.adjustLinearSelection( 1 )
.collapseToStart()
.insertContent( [
{ type: 'table' },
{ type: 'tableCaption' },
{ type: 'paragraph' }, 'C', 'a', 'p', 't', 'i', 'o', 'n', { type: '/paragraph' },
{ type: '/tableCaption' },
{ type: 'tableSection', attributes: { style: 'body' } },
{ type: 'tableRow' },
{ type: 'tableCell', attributes: { style: 'header' } },
{ type: 'paragraph' }, 'A', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: 'tableCell', attributes: { style: 'data' } },
{ type: 'paragraph' }, 'A', '1', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: 'tableCell', attributes: { style: 'data' } },
{ type: 'paragraph' }, 'A', '2', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: 'tableCell', attributes: { style: 'data' } },
{ type: 'paragraph' }, 'A', '3', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: '/tableRow' },
{ type: 'tableRow' },
{ type: 'tableCell', attributes: { style: 'header' } },
{ type: 'paragraph' }, 'B', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: 'tableCell', attributes: { style: 'data' } },
{ type: 'paragraph' }, 'B', '1', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: 'tableCell', attributes: { style: 'data' } },
{ type: 'paragraph' }, 'B', '2', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: 'tableCell', attributes: { style: 'data' } },
{ type: 'paragraph' }, 'B', '3', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: '/tableRow' },
{ type: '/tableSection' },
{ type: '/table' }
] );