**[[質問箱3/227]] [#v7df5e63]
#author("2018-03-11T16:04:02+09:00;2005-11-22T01:16:13+09:00","","")
**[[質問箱/3227]] [#v7df5e63]
|RIGHT:70|LEFT:410|c
|~カテゴリ||
|~サマリ|表組みに背景画像を使用したい|
|~バージョン|1.4.5|
|~投稿者|[[荻]]|
|~状態|質問|
|~投稿日|&new{2005-10-22 (土) 18:57:55};|
***質問 [#o657a49c]
タイトルの通りです。
表組みではBGCOLOR(色):を使って背景色指定ができますが、
これと同じような方法で表組みに背景画像指定をすることはできませんか?
分かる方、よろしくお願いします。

***回答 [#b6dbd135]
- 基本機能ではできないはず。本体の一部改造で対応できましたので参考になれば↓ -- [[0]] &new{2005-11-22 (火) 01:04:49};
 -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];
 	}
 }
-- ↑上記は“lib/convert_html.php”の470行目付近です。テーブルに対して一つの背景画像((例: <table style="background:url(image)">))を使いたいのかどうか悩みましたが、同じような方法とあったので、セルごとの背景画像指定にしました。 --  &new{2005-11-22 (火) 01:16:12};

#comment


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 5.6.40-0+deb8u12. HTML convert time: 0.040 sec.

OSDN