填充从外表边界线 [英] padding from outside table border line
问题描述
快速问题。我有一张桌子,它有一个边框。当我添加填充时,它会从表格中添加内部。
尊重
(无论我显示的是什么)
我不是100%肯定你的意思,但你可能想要这个。
HTML:
< table>
< tr>
< td>储存格1< / td>
< td>单元2< / td>
< / tr>
< / table>
CSS:
body {
padding:20px;
}
table {
width:400px;
height:400px;
outline:2px solid red;
outline-offset:-15px;
}
td {
border:2px solid blue;
}
仅表:
$ b
仅限单元格:
c $ c> outline ,你可以在它上面加上 outline-offset
。因此,如果使用 -
值,这将使它进入表。使用它作为边框,但记住它不计入宽度或高度。
注意:您可以在每个单元格等上使用。
quick question. I have a table, it has a border. When I add padding, it adds the padding from the inside of the table. Any way to make it add padding from outside the border?
Essentially, the table border lines should appear to be within its cell.
Regards (Whatever I am displayed as)
Im not 100% sure what you mean but you may want this.
HTML:
<table>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
CSS:
body {
padding: 20px;
}
table {
width: 400px;
height: 400px;
outline:2px solid red;
outline-offset: -15px;
}
td {
border:2px solid blue;
}
Table only:
Cell only:
So here we are setting an outline
and you can put an outline-offset
on it. So this will bring it into the table if you use -
value. Use it as a border but remember it doesn't count towards width or height.
Note: You can use this on each cell etc.
这篇关于填充从外表边界线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!