{"action":"created","issue":{"url":"https://api.github.com/repos/simonbengtsson/jsPDF-AutoTable/issues/273","repository_url":"https://api.github.com/repos/simonbengtsson/jsPDF-AutoTable","labels_url":"https://api.github.com/repos/simonbengtsson/jsPDF-AutoTable/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/simonbengtsson/jsPDF-AutoTable/issues/273/comments","events_url":"https://api.github.com/repos/simonbengtsson/jsPDF-AutoTable/issues/273/events","html_url":"https://github.com/simonbengtsson/jsPDF-AutoTable/issues/273","id":247339154,"number":273,"title":"Changing the Column Width","user":{"login":"Nicolaiaiai","id":30345871,"avatar_url":"https://avatars0.githubusercontent.com/u/30345871?v=4","gravatar_id":"","url":"https://api.github.com/users/Nicolaiaiai","html_url":"https://github.com/Nicolaiaiai","followers_url":"https://api.github.com/users/Nicolaiaiai/followers","following_url":"https://api.github.com/users/Nicolaiaiai/following{/other_user}","gists_url":"https://api.github.com/users/Nicolaiaiai/gists{/gist_id}","starred_url":"https://api.github.com/users/Nicolaiaiai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nicolaiaiai/subscriptions","organizations_url":"https://api.github.com/users/Nicolaiaiai/orgs","repos_url":"https://api.github.com/users/Nicolaiaiai/repos","events_url":"https://api.github.com/users/Nicolaiaiai/events{/privacy}","received_events_url":"https://api.github.com/users/Nicolaiaiai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-02T10:13:23Z","updated_at":"2017-08-02T10:26:38Z","closed_at":null,"body":"Hello! It's me again\r\n\r\nHow do I change the Column Width of my Table?\r\nMy Code looks like this:\r\n\r\n                base64Img = base64;\r\n                var pageContent = function (data) {\r\n                    /* Header */\r\n                    if (data.pageCount == 1) {\r\n                        doc.addImage(base64Img, 'png', data.settings.margin.left, 15, 30, 5);\r\n                        doc.setFontSize(10);\r\n\r\n                        /* Footer */\r\n                        var str = \"Seite \" + data.pageCount;\r\n                        doc.setFontSize(10);\r\n                        doc.text(str, 180, doc.internal.pageSize.height - 10);\r\n\r\n                        doc.setFontSize(8);\r\n                        doc.text(\"[TEXT], \" + datetime, 100, 16);\r\n                        doc.setFontSize(15);\r\n                        doc.text(\"[TEXT]\" + branche, data.settings.margin.left, 36);\r\n                    }\r\n                    else {\r\n                        var str = \"Seite \" + data.pageCount;\r\n                        doc.setFontSize(10);\r\n                        doc.text(str, 180, doc.internal.pageSize.height -5);\r\n                    }\r\n\r\n                };\r\n\r\n                var currentdate = new Date();\r\n                var datetime = currentdate.getDate() + \"/\" + (currentdate.getMonth() + 1) + \"/\" + currentdate.getFullYear();\r\n                console.log(datetime);\r\n                var doc = new jsPDF();\r\n\r\n                var elem = document.getElementById(\"tbl1\");\r\n                var res = doc.autoTableHtmlToJson(elem);\r\n                doc.autoTable(res.columns, res.data, {\r\n                    addPageContent: pageContent,\r\n                    startY: 43,\r\n                    margin: {horizontal: 7},\r\n                    styles: {overflow: 'linebreak', columnWidth: 'auto'},\r\n                    columnStyles: {0: {columnWidth: '15%'}}\r\n                });\r\n                doc.save(\"[NAME].pdf\");\r\n                return doc;\r\n            });\r\n\r\n\r\nThe first Column in my Table is a Number. If the Number binary (for example '23') the Output looks weird...\r\nIt looks like this:\r\nNr ..\r\n2  ...\r\n3  ...\r\n2  ... \r\n4  ...\r\n\r\n\r\nI tried solving the Problem by adding this:\r\n\r\ncolumnStyles: {0: {columnWidth: '15%'}}\r\n\r\nbut it looks like it won't work.\r\n\r\nI hope you understand my Problem.\r\nHave a nice Day\r\n\r\nNicolai\r\n"},"comment":{"url":"https://api.github.com/repos/simonbengtsson/jsPDF-AutoTable/issues/comments/319633396","html_url":"https://github.com/simonbengtsson/jsPDF-AutoTable/issues/273#issuecomment-319633396","issue_url":"https://api.github.com/repos/simonbengtsson/jsPDF-AutoTable/issues/273","id":319633396,"user":{"login":"Nicolaiaiai","id":30345871,"avatar_url":"https://avatars0.githubusercontent.com/u/30345871?v=4","gravatar_id":"","url":"https://api.github.com/users/Nicolaiaiai","html_url":"https://github.com/Nicolaiaiai","followers_url":"https://api.github.com/users/Nicolaiaiai/followers","following_url":"https://api.github.com/users/Nicolaiaiai/following{/other_user}","gists_url":"https://api.github.com/users/Nicolaiaiai/gists{/gist_id}","starred_url":"https://api.github.com/users/Nicolaiaiai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nicolaiaiai/subscriptions","organizations_url":"https://api.github.com/users/Nicolaiaiai/orgs","repos_url":"https://api.github.com/users/Nicolaiaiai/repos","events_url":"https://api.github.com/users/Nicolaiaiai/events{/privacy}","received_events_url":"https://api.github.com/users/Nicolaiaiai/received_events","type":"User","site_admin":false},"created_at":"2017-08-02T10:26:38Z","updated_at":"2017-08-02T10:26:38Z","body":"It's still not working, even though i specify the columnWidth like you did\r\n\r\nIf i type \r\n\r\n{0: {columnWidth: 100}}\r\n\r\nIs the '100' 100px width or 100% width?"}}
{"actor":{"display_login":"Nicolaiaiai"}}