File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,7 @@ class HtmlTable {
152152 public $ thead ;
153153 public $ tbody ;
154154 public $ caption = '' ;
155- public $ capid = "" ;
156- public $ capclass = "" ;
155+ public $ caption_attributes = "" ;
157156
158157 private function set_attributes ($ attributes ) {
159158 $ this ->attributes =$ attributes ;
@@ -178,7 +177,12 @@ public function get_html() {
178177 }
179178
180179 private function create_content () {
181- return $ this ->thead ->get_html ().$ this ->tbody ->get_html ();
180+ $ caption_content ='' ;
181+ if (trim ($ this ->caption )!='' ) {
182+ $ temp = new HtmlElement ('caption ' ,$ this ->caption ,$ this ->caption_attributes );
183+ $ caption_content = $ temp ->get_html ();
184+ }
185+ return $ caption_content .$ this ->thead ->get_html ().$ this ->tbody ->get_html ();
182186 }
183187}
184188
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ class for creating dynamic html table
44Usage Example:
55
66$t=new HtmlTable('class="table"');
7+ $t->caption="Testing Table";
8+ $t->caption_attributes='style="font-weight: bold;"';
79$t->thead->add_row();
810$t->thead->th_array(array(
911 'SN',
You can’t perform that action at this time.
0 commit comments