*ヘッダセル<th>にabbr属性を指定したい [#gf7c3faf]
-ページ: [[BugTrack2]]
-投稿者: [[justitia]]
-優先順位: 低
-状態: 提案
-カテゴリー: 本体新機能
-投稿日: 2005-03-11 (金) 18:07:03
-バージョン:
**メッセージ [#p035f91d]
ヘッダセルにabbr属性を指定したい。
|CENTER:|CENTER:|h
|hogehoge|氏名|
このような場合、ヘッダセルの先頭にABBR(~):を記述すると、<th abbr="~">といった具合に出力して欲しい。
|CENTER:|CENTER:|h
|ABBR(hoge):hogehoge|ABBR(受験者):氏名|
-参考
--[[Another-lint>http://openlab.ring.gr.jp/k16/htmllint/explain.html#abbr-header-label]]
--[[Another-lint(WAI)>http://openlab.ring.gr.jp/k16/htmllint/explain-wai.html#5.6]]
----
-関連:[[BugTrack/522]]。captionとかも使えたら面白そうですね。 -- [[Ratbeta]] &new{2005-03-11 (金) 19:39:17};
-テストが不十分ですが以下でどうでしょう? -- [[Ratbeta]] &new{2005-03-11 (金) 19:52:59};
--- convert_html.1.7.php Fri Jan 21 22:17:16 2005
+++ convert_html.php Fri Mar 11 19:49:35 2005
@@ -467,19 +467,23 @@
{
parent::Element();
$this->style = $matches = array();
+ $this->abbr = "";
- while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\((\d+)\)):(.*)$/',
+ while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\((\d+)\)|ABBR\(([^\)]+)\)):(.*)$/',
$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];
+ } else if ($matches[5]) {
+ $this->abbr = htmlspecialchars($matches[5]);
+ $text = $matches[6];
}
}
if ($is_template && is_numeric($text))
@@ -526,6 +530,9 @@
}
if (! empty($this->style))
$param .= ' style="' . join(' ', $this->style) . '"';
+
+ if (! empty($this->abbr))
+ $param .= ' abbr="' . $this->abbr . '"';
return $this->wrap(parent::toString(), $this->tag, $param, FALSE);
}
- 関連: [[official:質問箱4/540]] 。セル内の上下寄せの話 -- &new{2010-08-16 (月) 22:06:51};
- [[BugTrack2/19]] wikiソースの列揃えの話 -- &new{2010-08-16 (月) 22:06:51};
- [[PukiWiki/1.4/NewTable#w42346cd]] CAPTION実装の話 -- &new{2010-08-19 (木) 23:25:48};
#comment