删除表格单元格的边框 [英] Removing border from table cells

查看:69
本文介绍了删除表格单元格的边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个愚蠢的问题,但我似乎完全忘记了如何做.

I know this is a dumb question but I seem to have totally forgotten how to do it.

我有一个HTML table ,我想删除所有单元格周围的所有边框,以便整个表格周围只有一个边框.

I have a HTML table and I want to remove all borders around all the cells so that there is only one border around the entire table.

我的代码如下:

<table border='1' width='500'>
  <tr><th><h1>Your Wheelbarrow</h1></th><tr>
    <th>Product</th>
    <th>Description</th>
    <th>Price</th>
    <th>Quantity</th>
    <th>Total</th>
    <th>Delete</th>
  </tr>

推荐答案

只需折叠表格边框并从表格单元格中删除边框( td 元素).

Just collapse the table borders and remove the borders from table cells (td elements).

table {
    border: 1px solid #CCC;
    border-collapse: collapse;
}

td {
    border: none;
}

不保证未明确设置跨表浏览器删除表格单元格边框的情况.

Without explicitly setting border-collapse cross-browser removal of table cell borders is not guaranteed.

这篇关于删除表格单元格的边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆