Setting the padding and removing the border-spacing will do the trick:
(设置填充并删除边框间距将达到目的:)
table { border: 1px solid #ddd; padding: 0; border-collapse: collapse; } td { padding: 2px 10px; } td.gray { background:#ddd }
<table> <tr> <td class="gray"> Module description </td> </tr> <tr> <td> This module aims to provide a comprehensive knowledge and experience of the relational database model and its effective design, administration and implementation in order to to support data driven applications.</td> </table>
A little background: with border-collapse
(see docs ) you define whether cell borders are separate (like in your question) or collapsed.
(一些背景知识:使用border-collapse
(请参阅docs ),您可以定义单元格边框是分开的(如您的问题)还是折叠的。)
Rowspan
only works for expanding a cell vertically across more than one row (tr) and hence did not do anything here. (Rowspan
仅适用于在一个以上的行(tr)上垂直扩展一个单元格,因此在此不做任何事情。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…