Typecho显示表格

测试显示表格

Tables Are Cool
col 1 is left-aligned $1600
col 2 is centered $12
col 3 is right-aligned $1

Typecho默认的模板没有带表格的CSS属性,所以markdown是不显示表格模式的,自己打开默认模板的目录,找到style.css,添加如下内容就可以显示表格了。

/*table format*/
table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
table th {
font-weight: bold;
}
table th,
table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
table tr:nth-child(2n) {
background-color: #f8f8f8;
}

然后保存style.css,再刷新网页就可以看到正常的表格了,如果风格自己不喜欢可以自己自定义。

Leave a Reply

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注