如何设置< table>边框宽度与CSS? [英] How do I set <table> border width with CSS?
本文介绍了如何设置< table>边框宽度与CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么这样工作?
<table border=1>
这不是?
<table style="border-width:1px;border-color:black">
我在Chrome和IE9中得到的结果相同。
I get the same result in Chrome and in IE9.
推荐答案
使用css对表格执行边框有点复杂(但不是那么多,请参见 this jsfiddle as example ):
doing borders on tables with css is a bit more complicated (but not as much, see this jsfiddle as example):
<style type="text/css">
table{
border-collapse: collapse;
border: 1px solid black;
}
table td{
border: 1px solid black;
}
</style>
<table>
<tr>
<td>test</td>
<td>test</td>
</tr>
</table>
这篇关于如何设置< table>边框宽度与CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文