カテゴリ | |
---|---|
サマリ | 表組みに背景画像を使用したい |
バージョン | 1.4.5 |
投稿者 | 荻 |
状態 | 質問 |
投稿日 | 2005-10-22 (土) 18:57:55 |
タイトルの通りです。 表組みではBGCOLOR(色):を使って背景色指定ができますが、 これと同じような方法で表組みに背景画像指定をすることはできませんか? 分かる方、よろしくお願いします。
-while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\((\d+)\)):(.*)$/', +while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\((\d+)\)|BG\((.*)\)):(.*)$/', $text, $matches)) { if ($matches[1]) { $this->style['align'] = 'text-align:' . strtolower($matches[1]) . ';'; - $text = $matches[5]; + $text = $matches[6]; } else if ($matches[3]) { $name = $matches[2] ? 'background-color' : 'color'; $this->style[$name] = $name . ':' . htmlspecialchars($matches[3]) . ';'; - $text = $matches[5]; + $text = $matches[6]; } else if ($matches[4]) { $this->style['size'] = 'font-size:' . htmlspecialchars($matches[4]) . 'px;'; - $text = $matches[5]; + $text = $matches[6]; + } elseif ($matches[5]) { + $this->style['bg'] = 'background: url(' . htmlspecialchars($matches[5]) . ');'; + $text = $matches[6]; } }