| @@ -190,9 +190,9 @@ | ||
| 190 | 190 | if ( ! empty( $this->style_settings['class'] ) ) { |
| 191 | 191 | $this->table_style .= ' class="' . esc_attr( $this->style_settings['class'] ) . '"'; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - if ( ! empty( $this->width ) ) { | |
| 194 | + if ( $this->width ) { | |
| 195 | 195 | $this->table_style .= ' width="' . esc_attr( $this->width ) . '"'; |
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | |
| @@ -203,15 +203,17 @@ | ||
| 203 | 203 | * |
| 204 | 204 | * @return void |
| 205 | 205 | */ |
| 206 | 206 | private function init_td_style() { |
| 207 | - if ( $this->use_inline_style === true ) { | |
| 208 | - $td_style_attributes = 'text-align:' . ( $this->direction === 'rtl' ? 'right' : 'left' ) . ';'; | |
| 209 | - $td_style_attributes .= 'color:' . $this->style_settings['text_color'] . ';padding:' . $this->cell_padding . ';vertical-align:top;'; | |
| 210 | - $td_style_attributes .= 'border-top:' . $this->style_settings['border_width'] . ' solid ' . $this->style_settings['border_color'] . ';'; | |
| 207 | + if ( $this->use_inline_style !== true ) { | |
| 208 | + return; | |
| 209 | + } | |
| 211 | 210 | |
| 212 | - $this->td_style = ' style="' . esc_attr( $td_style_attributes ) . '"'; | |
| 213 | - } | |
| 211 | + $td_style_attributes = 'text-align:' . ( $this->direction === 'rtl' ? 'right' : 'left' ) . ';'; | |
| 212 | + $td_style_attributes .= 'color:' . $this->style_settings['text_color'] . ';padding:' . $this->cell_padding . ';vertical-align:top;'; | |
| 213 | + $td_style_attributes .= 'border-top:' . $this->style_settings['border_width'] . ' solid ' . $this->style_settings['border_color'] . ';'; | |
| 214 | + | |
| 215 | + $this->td_style = ' style="' . esc_attr( $td_style_attributes ) . '"'; | |
| 214 | 216 | } |
| 215 | 217 | |
| 216 | 218 | /** |
| 217 | 219 | * Removes border CSS from HTML. |