{"action":"created","issue":{"url":"https://api.github.com/repos/rospdf/pdf-php/issues/42","repository_url":"https://api.github.com/repos/rospdf/pdf-php","labels_url":"https://api.github.com/repos/rospdf/pdf-php/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/rospdf/pdf-php/issues/42/comments","events_url":"https://api.github.com/repos/rospdf/pdf-php/issues/42/events","html_url":"https://github.com/rospdf/pdf-php/pull/42","id":188909397,"number":42,"title":"added new table features: evenColumns, text color, background color","user":{"login":"Manuzza","id":476640,"avatar_url":"https://avatars.githubusercontent.com/u/476640?v=3","gravatar_id":"","url":"https://api.github.com/users/Manuzza","html_url":"https://github.com/Manuzza","followers_url":"https://api.github.com/users/Manuzza/followers","following_url":"https://api.github.com/users/Manuzza/following{/other_user}","gists_url":"https://api.github.com/users/Manuzza/gists{/gist_id}","starred_url":"https://api.github.com/users/Manuzza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manuzza/subscriptions","organizations_url":"https://api.github.com/users/Manuzza/orgs","repos_url":"https://api.github.com/users/Manuzza/repos","events_url":"https://api.github.com/users/Manuzza/events{/privacy}","received_events_url":"https://api.github.com/users/Manuzza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-11-12T12:32:07Z","updated_at":"2016-11-14T13:02:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rospdf/pdf-php/pulls/42","html_url":"https://github.com/rospdf/pdf-php/pull/42","diff_url":"https://github.com/rospdf/pdf-php/pull/42.diff","patch_url":"https://github.com/rospdf/pdf-php/pull/42.patch"},"body":"# New table option: \"evenColumns\"\r\n\r\ndefault value = 0 (it does nothing)\r\n\r\nIf evenColumns = 1 then instead of calculating the width based on the size of the content it will spread the columns evenly (each column will be the same width). Note that it will only evenly distribute columns that do NOT have a specified width. For example, columns that have a manually specified width will continue to use that width.\r\n\r\nIf evenColumns = 2 then it will only evenly balance the columns if the following criteria is met:\r\n1. The first width calculations were wider than the available space.\r\n2. One of the recalculated columns is very narrow.\r\n\r\nThis solves the problem that occurs when a column is very narrow and the table generator gets stuck in a loop adding page after page trying to make the content fit.\r\n\r\n# New cell option for specifying the Text and Background color:\r\n\r\nEvery single cell in a table can now have its own specific background color AND text color. For any cell in the data array you want to change the colour, simply add the fields [columnName]Fill and [columnName]Text with a color array.\r\n\r\nFor example if we enhance the example in the manual (additions in bold):\r\n\r\n$data = array(\r\narray('num'=>1,'name'=>'gandalf','type'=>'wizard',**'typeFill'=>array(0,1,0)**)\r\n,array('num'=>2,'name'=>'bilbo','type'=>'hobbit',**'typeFill'=>array(0.588235294118, 0.407843137255, 0)**)\r\n,array('num'=>3,'name'=>'frodo','type'=>'hobbit',**'typeFill'=>array(0.588235294118, 0.407843137255, 0)**)\r\n,array('num'=>4,'name'=>'saruman','type'=>'bad dude',**'typeFill'=>array(1,0,0),'typeText'=>array(1,1,1,)**)\r\n,array('num'=>5,'name'=>'sauron','type'=>'really bad dude',**'typeFill'=>array(0,0,0),'typeText'=>array(1,1,1,)**)\r\n);\r\n\r\nThe cell containing the word:\r\n\"wizard\" will have a green background.\r\n\"hobbit\" will have a brown background.\r\n\"bad dude\" will have a red background with white text.\r\n\"really bad dude\" will have a black background with white text.\r\n\r\nBackground colors of a cell will be selected using the following precedence:\r\n1. A specified color for the cell.\r\n2. A specified color for the column.\r\n3. The shadeCol or shadeCol2 (depending on what \"shaded\" is set to).\r\n"},"comment":{"url":"https://api.github.com/repos/rospdf/pdf-php/issues/comments/260329106","html_url":"https://github.com/rospdf/pdf-php/pull/42#issuecomment-260329106","issue_url":"https://api.github.com/repos/rospdf/pdf-php/issues/42","id":260329106,"user":{"login":"Manuzza","id":476640,"avatar_url":"https://avatars.githubusercontent.com/u/476640?v=3","gravatar_id":"","url":"https://api.github.com/users/Manuzza","html_url":"https://github.com/Manuzza","followers_url":"https://api.github.com/users/Manuzza/followers","following_url":"https://api.github.com/users/Manuzza/following{/other_user}","gists_url":"https://api.github.com/users/Manuzza/gists{/gist_id}","starred_url":"https://api.github.com/users/Manuzza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manuzza/subscriptions","organizations_url":"https://api.github.com/users/Manuzza/orgs","repos_url":"https://api.github.com/users/Manuzza/repos","events_url":"https://api.github.com/users/Manuzza/events{/privacy}","received_events_url":"https://api.github.com/users/Manuzza/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T13:02:20Z","updated_at":"2016-11-14T13:02:20Z","body":"Regarding evenColumns = 2:\r\n\r\nWe have always had intermittent problems with tables not rendering properly. We can have dozen of tables in an output and some of those have 8-10 columns in a table that can span 50 or so pages. Every now and again one column in one row that is usually no more that 10 characters can all of a sudden have 50 characters.\r\n\r\nIn the past when the generation crashes (insufficient RAM) the solution is to manually go comment out every table until you find the culprit and mess with it until you get it working again.\r\n\r\nThe evenColumns 2 is a catch-all that stops this from occurring on odd occasions. Using even columns can look ugly but at least the output is still guaranteed to work. We can then manually narrow or widen specific columns to improve the appearance as the need arises... "}}
{"actor":{"display_login":"Manuzza"}}