ページの CSS ファイルのために特定のスタイルを持つテーブルがあります (青い枠線などがあります)。
その特定のテーブルの CSS を削除する簡単な方法はありますか? 私は次のようなコマンドの行に沿って何かを考えていました:
style="nostyle"
このようなものは存在しますか?
ページの CSS ファイルのために特定のスタイルを持つテーブルがあります (青い枠線などがあります)。
その特定のテーブルの CSS を削除する簡単な方法はありますか? 私は次のようなコマンドの行に沿って何かを考えていました:
style="nostyle"
このようなものは存在しますか?
これを試して。
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
YUI CSS reset のような CSS リセットを使用します。
すべてのプロパティの CSS を確実に設定解除したい場合は、次を使用できます。
table, caption, tbody, tfoot, thead, tr, th, td {
all: unset;
}
all
プロパティに関する MDN ドキュメント: https://developer.mozilla.org/en-US/docs/Web/CSS/all
jqueryuiとtablesorter pluginの両方を使用する Web サイトで、tablesorter テーブル内のテーブルにこのようなものを探していました。ここでの回答のいくつかは役に立ちましたが、特に tablesorter は :hover を使用し、jquery ui はコーナーの丸めなどを使用するため、十分ではありませんでした。
テーブルに適用すると、いくつかの実用的なデフォルトにクリーンアップするクラスを宣言しました。この css は、クリーンアップが必要な他のクラスよりも前に宣言する必要があります。つまり、この css に宣言するか、セクションの上部のタグに<link>
配置します。<style>
<head>
.defaulttable {
display: table;
}
.defaulttable thead {
display: table-header-group;
}
.defaulttable tbody {
display: table-row-group;
}
.defaulttable tfoot {
display: table-footer-group;
}
.defaulttable tbody>tr:hover,
.defaulttable tbody>tr {
display: table-row;
}
.defaulttable tbody>tr:hover>td,
.defaulttable tbody>tr>td {
display: table-cell;
}
.defaulttable,
.defaulttable tbody,
.defaulttable tbody>tr:hover,
.defaulttable tbody>tr,
.defaulttable tbody>tr:hover>td,
.defaulttable tbody>tr>td,
.defaulttable tbody>tr:hover>th,
.defaulttable tbody>tr>th,
.defaulttable thead>tr:hover>td,
.defaulttable thead>tr>td,
.defaulttable thead>tr:hover>th,
.defaulttable thead>tr>th,
.defaulttable tfoot>tr:hover>td,
.defaulttable tfoot>tr>td,
.defaulttable tfoot>tr:hover>th,
.defaulttable tfoot>tr>th {
background: transparent;
border: 0px solid #000;
border-spacing: 0px;
border-collapse: separate;
empty-cells: show;
padding: 0px;
margin: 0px;
outline: 0px;
font-size: 100%;
color: #000;
vertical-align: top;
text-align: left;
font-family: sans-serif;
table-layout: auto;
caption-side: top;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
次に、「デフォルト」にするテーブルにクラスを適用するだけです。
<table class="defaulttable and whatever else you want">
<tbody>
<tr>
<td>This will appear with sensible defaults.</td>
</tr>
</tbody>
</table>