質問箱/3510
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
**[[質問箱/3510]] [#v5e2a71c]
|RIGHT:70|LEFT:410|c
|~カテゴリ||
|~サマリ|表組みの枠の色を変更することはできませんでしょう...
|~バージョン|1.4.7|
|~投稿者|[[summer]]|
|~状態|完了|
|~投稿日|&new{2006-10-08 (日) 18:50:18};|
***質問 [#vbc00ffe]
背景色の枠の表組みを作成して配置したい場合と、普通の色の...
色はCOLORで指定できますが、枠の色を変更する方法がありまし...
[[質問箱/2251]]の方法だと1色しか使えませんので。
どうぞよろしくお願い致します。
***回答 [#ec392c9d]
- どぞ。[[teanan:自作プラグイン/table_color]] -- [[teanan...
***ありがとうございます [#q10041b8]
パッチまで作っていただいて、本当に本当にありがとうござい...
標準機能ではできないのですね。
早速、試してみたのですが出力されるHTMLが
<table class="style_table"
から変化しません。
何度見直しても、分からないのですが、アドバイスいただけま...
どうぞよろしくお願いします。
cssは例題をそのまま使用しました
(convert_htm.php)
// '|'-separated table
function & Factory_Table(& $root, $text)
{
//KM if (! preg_match('/^\|(.+)\|([hHfFcC]?)$/', $text, ...
if (! preg_match('/^\|(.+)\|([hHfFcCsS]?)$/', $text, $ou...
return Factory_Inline($text);
} else {
return new Table($out);
}
}
class Table extends Element
{
var $type;
var $types;
var $col; // number of column
var $style; //KM ADD
function Table($out)
{
parent::Element();
$cells = explode('|', $out[1]);
$this->col = count($cells);
$this->type = strtolower($out[2]);
$this->types = array($this->type);
$is_template = ($this->type == 'c');
$row = array();
//KM foreach ($cells as $cell)
//KM $row[] = & new TableCell($cell, $is_template);
$this->style = 'style_table';
if($this->type == 's') {
$this->style = htmlspecialchars(array_shift($cells));
} else {
foreach ($cells as $cell)
$row[] = & new TableCell($cell, $is_template);
}
$this->elements[] = $row;
}
function canContain(& $obj)
{
return is_a($obj, 'Table') && ($obj->col == $this->col);
}
function & insert(& $obj)
{
$this->elements[] = $obj->elements[0];
$this->types[] = $obj->type;
return $this;
}
function toString()
{
static $parts = array('h'=>'thead', 'f'=>'tfoot', ''=>'...
// Set rowspan (from bottom, to top)
for ($ncol = 0; $ncol < $this->col; $ncol++) {
$rowspan = 1;
foreach (array_reverse(array_keys($this->elements)) as...
$row = & $this->elements[$nrow];
if ($row[$ncol]->rowspan == 0) {
++$rowspan;
continue;
}
$row[$ncol]->rowspan = $rowspan;
// Inherits row type
while (--$rowspan)
$this->types[$nrow + $rowspan] = $this->types[$nrow];
$rowspan = 1;
}
}
// Set colspan and style
$stylerow = NULL;
foreach (array_keys($this->elements) as $nrow) {
$row = & $this->elements[$nrow];
if ($this->types[$nrow] == 'c')
$stylerow = & $row;
$colspan = 1;
foreach (array_keys($row) as $ncol) {
if ($row[$ncol]->colspan == 0) {
++$colspan;
continue;
}
$row[$ncol]->colspan = $colspan;
if ($stylerow !== NULL) {
$row[$ncol]->setStyle($stylerow[$ncol]->style);
// Inherits column style
while (--$colspan)
$row[$ncol - $colspan]->setStyle($stylerow[$ncol]->...
}
$colspan = 1;
}
}
// toString
$string = '';
foreach ($parts as $type => $part)
{
$part_string = '';
foreach (array_keys($this->elements) as $nrow) {
if ($this->types[$nrow] != $type)
continue;
$row = & $this->elements[$nrow];
$row_string = '';
foreach (array_keys($row) as $ncol)
$row_string .= $row[$ncol]->toString();
$part_string .= $this->wrap($row_string, 'tr');
}
$string .= $this->wrap($part_string, $part);
}
//KM $string = $this->wrap($string, 'table', ' class="s...
//KM ADD
$string = $this->wrap($string, 'table', ' class="' .
htmlspecialchars($this->style) . '" cellspacing="1" bo...
return $this->wrap($string, 'div', ' class="ie5"');
}
}
- すみません、wikiの書式例が間違っていました。パッチは合...
|style_table2|||s
|hoge1|hoge2|hoge3|
|A|B|B|
- 出来ました。本当にありがとうございました。⌣ -- [[...
- 色々、使ってみました。
パッチありがとうございました。1つお聞きしたいのですが。S...
やりたいことは以下のようなことなのですが。
|style_table2:SIZE(16):200|SIZE(16):200|SIZE(16):300|s
|hoge1|hoge2|hoge3|
|A|B|B|
作っていただき、本当にあつかましいのですが。これができる...
- 装飾子 s では、スタイルの指定のみにしてください。その他...
|style_table2|||s
|SIZE(16):200|SIZE(16):200|SIZE(16):300|c
|hoge1|hoge2|hoge3|
|A|B|B|
- なるほど、そういうことだったのですね。大変ありがとうご...
//#comment
終了行:
**[[質問箱/3510]] [#v5e2a71c]
|RIGHT:70|LEFT:410|c
|~カテゴリ||
|~サマリ|表組みの枠の色を変更することはできませんでしょう...
|~バージョン|1.4.7|
|~投稿者|[[summer]]|
|~状態|完了|
|~投稿日|&new{2006-10-08 (日) 18:50:18};|
***質問 [#vbc00ffe]
背景色の枠の表組みを作成して配置したい場合と、普通の色の...
色はCOLORで指定できますが、枠の色を変更する方法がありまし...
[[質問箱/2251]]の方法だと1色しか使えませんので。
どうぞよろしくお願い致します。
***回答 [#ec392c9d]
- どぞ。[[teanan:自作プラグイン/table_color]] -- [[teanan...
***ありがとうございます [#q10041b8]
パッチまで作っていただいて、本当に本当にありがとうござい...
標準機能ではできないのですね。
早速、試してみたのですが出力されるHTMLが
<table class="style_table"
から変化しません。
何度見直しても、分からないのですが、アドバイスいただけま...
どうぞよろしくお願いします。
cssは例題をそのまま使用しました
(convert_htm.php)
// '|'-separated table
function & Factory_Table(& $root, $text)
{
//KM if (! preg_match('/^\|(.+)\|([hHfFcC]?)$/', $text, ...
if (! preg_match('/^\|(.+)\|([hHfFcCsS]?)$/', $text, $ou...
return Factory_Inline($text);
} else {
return new Table($out);
}
}
class Table extends Element
{
var $type;
var $types;
var $col; // number of column
var $style; //KM ADD
function Table($out)
{
parent::Element();
$cells = explode('|', $out[1]);
$this->col = count($cells);
$this->type = strtolower($out[2]);
$this->types = array($this->type);
$is_template = ($this->type == 'c');
$row = array();
//KM foreach ($cells as $cell)
//KM $row[] = & new TableCell($cell, $is_template);
$this->style = 'style_table';
if($this->type == 's') {
$this->style = htmlspecialchars(array_shift($cells));
} else {
foreach ($cells as $cell)
$row[] = & new TableCell($cell, $is_template);
}
$this->elements[] = $row;
}
function canContain(& $obj)
{
return is_a($obj, 'Table') && ($obj->col == $this->col);
}
function & insert(& $obj)
{
$this->elements[] = $obj->elements[0];
$this->types[] = $obj->type;
return $this;
}
function toString()
{
static $parts = array('h'=>'thead', 'f'=>'tfoot', ''=>'...
// Set rowspan (from bottom, to top)
for ($ncol = 0; $ncol < $this->col; $ncol++) {
$rowspan = 1;
foreach (array_reverse(array_keys($this->elements)) as...
$row = & $this->elements[$nrow];
if ($row[$ncol]->rowspan == 0) {
++$rowspan;
continue;
}
$row[$ncol]->rowspan = $rowspan;
// Inherits row type
while (--$rowspan)
$this->types[$nrow + $rowspan] = $this->types[$nrow];
$rowspan = 1;
}
}
// Set colspan and style
$stylerow = NULL;
foreach (array_keys($this->elements) as $nrow) {
$row = & $this->elements[$nrow];
if ($this->types[$nrow] == 'c')
$stylerow = & $row;
$colspan = 1;
foreach (array_keys($row) as $ncol) {
if ($row[$ncol]->colspan == 0) {
++$colspan;
continue;
}
$row[$ncol]->colspan = $colspan;
if ($stylerow !== NULL) {
$row[$ncol]->setStyle($stylerow[$ncol]->style);
// Inherits column style
while (--$colspan)
$row[$ncol - $colspan]->setStyle($stylerow[$ncol]->...
}
$colspan = 1;
}
}
// toString
$string = '';
foreach ($parts as $type => $part)
{
$part_string = '';
foreach (array_keys($this->elements) as $nrow) {
if ($this->types[$nrow] != $type)
continue;
$row = & $this->elements[$nrow];
$row_string = '';
foreach (array_keys($row) as $ncol)
$row_string .= $row[$ncol]->toString();
$part_string .= $this->wrap($row_string, 'tr');
}
$string .= $this->wrap($part_string, $part);
}
//KM $string = $this->wrap($string, 'table', ' class="s...
//KM ADD
$string = $this->wrap($string, 'table', ' class="' .
htmlspecialchars($this->style) . '" cellspacing="1" bo...
return $this->wrap($string, 'div', ' class="ie5"');
}
}
- すみません、wikiの書式例が間違っていました。パッチは合...
|style_table2|||s
|hoge1|hoge2|hoge3|
|A|B|B|
- 出来ました。本当にありがとうございました。⌣ -- [[...
- 色々、使ってみました。
パッチありがとうございました。1つお聞きしたいのですが。S...
やりたいことは以下のようなことなのですが。
|style_table2:SIZE(16):200|SIZE(16):200|SIZE(16):300|s
|hoge1|hoge2|hoge3|
|A|B|B|
作っていただき、本当にあつかましいのですが。これができる...
- 装飾子 s では、スタイルの指定のみにしてください。その他...
|style_table2|||s
|SIZE(16):200|SIZE(16):200|SIZE(16):300|c
|hoge1|hoge2|hoge3|
|A|B|B|
- なるほど、そういうことだったのですね。大変ありがとうご...
//#comment
ページ名: