| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- class NTKVBox
- {
- function NTKVBox($id, $padding, $spacing, $debug = False)
- {
- $this->id = $id;
- $this->padding = $padding;
- $this->spacing = $spacing;
- $this->debug = $debug;
-
- $this->elems = array();
- }
-
- function add($elem, $width = False, $height = False, $style = "")
- {
- $this->elems[] = array($elem, $width, $height, $style);
- }
-
- function getHtml()
- {
- $html = "";
- $html .= "<table id=\"$this->id\" class=\"vbox\" ";
- if($this->debug)
- $html .= "border=\"1\" ";
- $html .= "cellspacing=\"$this->spacing\" cellpadding=\"$this->padding\" style=\"table-layout: fixed; width: 100%; height: 100%;\">\n";
-
- for($i = 0; $i < count($this->elems); $i++)
- {
- $html .= "<tr>\n";
-
- if($this->elems[$i][1])
- $width = "100%";
- else
- $width = "1%";
-
- if($this->elems[$i][2])
- $height = "100%";
- else
- $height = "1%";
-
- $html .= "<td style=\"width: $width; height: $height; ".$this->elems[$i][3]."\">\n";
- $html .= "<center>\n";
- $html .= $this->elems[$i][0]->getHtml();
- $html .= "</center>\n";
- $html .= "</td>\n";
- $html .= "</tr>\n";
- }
- $html .= "</table>\n";
-
- return $html;
- }
- }
- ?>
|