From d5d6c30442f78563d8e21f23855e6bbcd0d0fc0c Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 1 Nov 2011 13:12:09 -0400 Subject: [PATCH] Adjust style settings to allow for more control over table. --- Gantt.php | 11 +++++++---- gantt_driver.php | 22 +++++++++++++++++++++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Gantt.php b/Gantt.php index 97bf9ed..b386eef 100644 --- a/Gantt.php +++ b/Gantt.php @@ -49,6 +49,7 @@ class Gantt { /** * Constructor + * @param bool whether or not to define a default set of colors (optional) **/ function __construct($colors = true) { //add a default set of colors @@ -117,15 +118,17 @@ class Gantt { foreach($this->events as $event) { $color = $this->get_color(); $this->html .= ' ' . "\n"; - $this->html .= ' ' . $event->event . '' . "\n"; - $this->html .= ' ' . $event->duration . '' . "\n"; + $this->html .= ' ' . $event->event . '' . "\n"; + $this->html .= ' ' . $event->duration . '' . "\n"; for($i = 1; $i <= $columns; $i++) { if($i >= $event->start && $i < ($event->start + $event->duration)) { $style = ' style="background-color:' . $color . '"'; + $class = ' colored'; } else { - $style = ' style="background-color:#fff"'; + $style = ''; + $class = ' blank'; } - $this->html .= '  ' . "\n"; + $this->html .= '  ' . "\n"; } $this->html .= ' ' . "\n"; } diff --git a/gantt_driver.php b/gantt_driver.php index 3832d27..4686691 100644 --- a/gantt_driver.php +++ b/gantt_driver.php @@ -13,12 +13,32 @@ border: 1px solid black; } +#gantt tr { + +} + #gantt td { border: 1px solid black; } +#gantt td.event { + font-weight: bold; + border: 1px solid black; +} +#gantt td.duration { + text-align: right; + border: 1px solid black; +} + +#gantt td.blank { + width: 50px; + background-color: #fff; +} + #gantt td.colored { - width: 18px; + width: 50px; + border-left: 0; + border-right: 0; }