我们怎样才能在CKEDITOR中只设置外边框到表格

时间:2017-11-03 10:47:20

标签: html css

我无法在CKEDITOR中仅将外部主体添加到HTML表中。我试图从CKEDITOR的高级选项中删除内部边框,但这样做也不行。

<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
  <tbody>
    <tr>
      <td border="0">&nbsp;</td>
      <td border="0">&nbsp;</td>
      <td border="0">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>

2 个答案:

答案 0 :(得分:-1)

因为您通过HTML设置了边框,这是默认行为。更好(在每种情况下)用CSS设置边框。

table {
  border: 1px solid #000;
}
<table cellpadding="1" cellspacing="1" style="width:500px">
  <tbody>
    <tr>
      <td border="0">&nbsp;</td>
      <td border="0">&nbsp;</td>
      <td border="0">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>

您还可以使用更多CSS删除cellpaddingcellspacing。有关更多信息,请参阅Set cellpadding and cellspacing in CSS?

答案 1 :(得分:-1)

试试这个。我添加了这个css:

table td {
  border: 0;
}
table {
  border: 1px solid #000;
}

&#13;
&#13;
table td {
  border: 0;
}
table {
  border:1px solid #000;
}
&#13;
<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
  <tbody>
    <tr>
      <td border="0">&nbsp;</td>
      <td border="0">&nbsp;</td>
      <td border="0">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
&#13;
&#13;
&#13;