Quantcast
Channel: CSSタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8929

Excel で、表の修飾を CSS で書き出すアドイン

$
0
0

ツール

TachyPochy/tableStyle_withContextMenu

はじめに

 同様のコンセプトをもつツールは多いと思いますが、nth-child でセルを指定するのが特徴です。

 以下のような用途で使用します。reStructuredText/Sphinx だけでなく、Markdown でも使えるかもしれません。

Sphinx、表の一部を装飾する(一部だけスタイルを変えたい) - Qiita

対応

 以下の装飾に対応しています。

  • 文字色
  • 背景色
  • 太字
  • イタリック
  • 下線

使い方

 スタイルを適用したセルの範囲を選択し、コンテキストメニューから CSS to Clipboad を選択してください。

図3.png

サンプルの出力結果

 クリップボードには、以下のコードが出力されます。HTML カラーコードは、可能なら色名に変換します。

<style type='text/css'>#theTableBlocktabletr:nth-child(1)th:nth-child(1){color:Red;background-color:Yellow;}#theTableBlocktabletr:nth-child(1)td:nth-child(2){background-color:Red;font-weight:bold;}#theTableBlocktabletr:nth-child(2)td:nth-child(3){background-color:Blue;font-style:italic;}#theTableBlocktabletr:nth-child(3)td:nth-child(4){background-color:#E6B8B7;text-decoration:underline;}</style><divid='theTableBlock'><!-- TODO : write your table tag code here --></div>

注意

 一行目は th として扱います。HTML を書くなら <thead>〜</thead> と <tbody>〜</tbody> が必要です。

<table><thead><tr><th>Test</th><th>Test</th><th>Test</th><th>Test</th></tr></thead><tbody><tr><td>Test</td><td>Test</td><td>Test</td><td>Test</td></tr><tr><td>Test</td><td>Test</td><td>Test</td><td>Test</td></tr><tr><td>Test</td><td>Test</td><td>Test</td><td>Test</td></tr></tbody></table>

ブラウザでのレンダリング例

図4.png


Viewing all articles
Browse latest Browse all 8929

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>