导出为PDF时,列内容超出uigrid angularjs中的列边框

导出为PDF时,列内容超出uigrid angularjs中的列边框,angularjs,angularjs-directive,angularjs-scope,angularjs-ng-repeat,angular-ui-grid,Angularjs,Angularjs Directive,Angularjs Scope,Angularjs Ng Repeat,Angular Ui Grid,如果我得到这样的列数据,中间没有空格 $scope.gridOptions.data=[{“name”:“rasheedsyedabdulhameed”}] 这是我的选择 $scope.gridOptions = { columnDefs: [ { field: 'name' }, { field: 'name' }, { field: 'name' } ], enableGridMenu: true, enableSelectAll: true, exporterCsvFilen

如果我得到这样的列数据,中间没有空格

$scope.gridOptions.data=[{“name”:“rasheedsyedabdulhameed”}]
这是我的选择

 $scope.gridOptions = {
columnDefs: [
  { field: 'name' },
  { field: 'name' },
  { field: 'name' }
],
enableGridMenu: true,
enableSelectAll: true,
exporterCsvFilename: 'myFile.csv',
exporterPdfDefaultStyle: {fontSize: 9},
exporterPdfTableStyle: {margin: [30, 30, 30, 30]},
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'},
exporterPdfHeader: { text: "My Header", style: 'headerStyle' },
exporterPdfFooter: function ( currentPage, pageCount ) {
  return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' };
},
exporterPdfCustomFormatter: function ( docDefinition ) {
  docDefinition.styles.headerStyle = { fontSize: 22, bold: true };
  docDefinition.styles.footerStyle = { fontSize: 10, bold: true };
  return docDefinition;
},
exporterPdfOrientation: 'landscape',
exporterPdfPageSize: 'LETTER',
exporterPdfMaxGridWidth: 500,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){
  $scope.gridApi = gridApi;
}
})


在导出为pdf工作表时,内容超出了列边框,这是我的示例plunker

您可以在每列上使用
宽度:“*”
,使其适应内容。但是,如果内容非常大,您的表格可能会超出页面大小。

您可以在每列上使用
宽度:“*”
,使其适应内容。但是,如果内容非常大,则表可能超出页面大小。

发现此示例非常有用,尤其是页脚/页眉属性。发现此示例非常有用,尤其是页脚/页眉属性。