0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CSSを画面に反映させる方法

Last updated at Posted at 2025-02-05

CSSを画面に反映させる方法は2つ

今回の例では、
①画面にあるすべてのテーブルに対して反映
②1つのテーブル(設定した特定の要素)に対して反映

①HTMLタグをStyle Sheet Editorに追加する

画面にあるすべてのテーブルに対して反映

テーブルウィジェットを画面にドラッグした時のデフォルト
1.png

Style Sheet Editorを開く
1.png

"table{}"のようにHTMLタグを記載する
2.png

table {
    border-collapse: collapse;
    border: 2px solid cornflowerblue !important;
}

table th {
    border: 2px solid cornflowerblue;
}

table td{
    border: 2px solid cornflowerblue;
}

2つのテーブルの枠の色が変わりました
7.png

②クラスを定義する

設定した特定の要素に反映される

クラスを定義した上で、ウィジェットのPropertiesのAttributeのclassに.を除いた文字列を設定
①との違いは先頭に .があるかどうか

5.png

.table-container{
border-collapse: collapse;
border: 2px solid cornflowerblue 
}
.table-container th {
    border: 2px solid cornflowerblue;
}
.table-container td{
    border: 2px solid cornflowerblue;
}

上のテーブルの枠の色が変わりました
8.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?