我试图在Wordpress帖子中设计一个表格,但很难让它正常工作。我已经将帖子设置为HTML编辑模式,可以获得一些样式,但不是全部。(老实说,这不是我第一次在使用表格样式方面遇到麻烦。)这篇文章的内容(使用精心设计的样式和高对比度的颜色,以便于识别元素)如下所示。
这是我得到的错误结果:
正如您所看到的,单元格没有选择样式,但表本身主要是这样。
我想可能是博客的主题造成了干扰,但从我对HTML的理解来看STYLE
表前面的标记应该覆盖它前面的任何内容(部分是这样做的)。如果我直接在TD
标签,这是可行的,但这显然不是一个切实可行的解决方案。
有人能帮我找出如何在Wordpress帖子中使用表格样式吗?非常感谢。
<小时/>
<!-- script type="text/javascript" src="/Common/JS/SortTable.js"></script -->
<style type="text/css">
table.sortable {
margin : auto;
border-style : dashed;
border-color : #000000;
border-width : 2px;
color : #000000;
background-color : #ff0000;
}
table.sortable td {
border-style : dashed;
border-color : #000000;
border-width : 2px;
width : 100px;
background-color : #0000ff;
}
table.sortable .title {
width : 300px;
background-color : #00ff00;
}
</style>
<table id="mylist" class="sortable">
<thead>
<tr>
<th>Title</th>
<th>Foo</th>
<th>Bar</th>
<th>Baz</th>
</tr>
</thead>
<tbody>
<tr>
<td class="title">Something</td>
<td sorttable_customkey="5"></td>
<td sorttable_customkey="5"></td>
<td sorttable_customkey="5"></td>
</tr>
<tr>
<td class="title">Something Better</td>
<td sorttable_customkey="4"></td>
<td sorttable_customkey="5"></td>
<td sorttable_customkey="5"></td>
</tr>
<tr>
<td class="title">Something Worse</td>
<td sorttable_customkey="3"></td>
<td sorttable_customkey="4"></td>
<td sorttable_customkey="3"></td>
</tr>
<tr>
<td class="title">Something Horrible</td>
<td sorttable_customkey="3"></td>
<td sorttable_customkey="4"></td>
<td sorttable_customkey="1"></td>
</tr>
</tbody>
</table>