css表格分两行

Starting Note:

开始说明:

Editing and styling go hand in hand during the development of a web page or a website. While you are editing an element of your web page or website you must also style that element according to the changes made, this is necessary as to make the appearance of your web page or website neat besides the page or site becomes structured and responsive. Therefore, one must know some fundamental properties of styling as well as editing in CSS. A good developer tends to learn various properties regularly and that helps in building a much more better and responsive website or web pages.

在开发网页或网站的过程中,编辑和样式是齐头并进的。 当您编辑网页或网站的元素时,还必须根据所做的更改对该元素进行样式设置,这对于使网页或网站的外观整洁,不仅使页面或网站变得结构化且具有响应性,这是必需的。 因此,必须了解样式以及CSS的一些基本属性。 一个好的开发人员倾向于定期学习各种属性,这有助于构建更好,响应更快的网站或网页。

Trivia:

琐事:

Since we are talking about styling and editing, let us have a look at the purpose of this article and try to understand how we can adjust spaces between two rows in a table by making use of CSS. This method is not at all tough all you need to do is edit some bits of code and surely you can achieve this easily without much of bran-wrecking work.

由于我们正在谈论样式和编辑,因此让我们看一下本文的目的,并尝试了解如何通过使用CSS调整表中两行之间的间距 。 这种方法根本不需要做的就是编辑一些代码,并且您肯定可以轻松地实现这一目标,而无需花费很多精力。

We have all dealt with tables or grids, they are also referred to as grids many times. It is considered a very good practice to include tables on your web page or website. Tables or grids can be used for many purposes, for example, they can be used to draw a comparison or differentiate between any two terms, or to provide some factual data and much more. Besides, including tables or grids also reduce your typing work. Therefore, if you think a table or grid would suffice without writing an entire paragraph for a certain piece of information, then you go ahead!

我们都处理过表格或网格,它们也多次被称为网格。 在您的网页或网站上包含表格被认为是一种很好的做法。 表格或网格可用于许多目的,例如,它们可用于进行比较或区分任意两个术语,或提供一些事实数据等等。 此外,包括表格或表格也可以减少您的打字工作。 因此,如果您认为表格或网格就足够了,而不必为某个信息编写整个段落,那么您就继续吧!

Method:

方法:

Now that we have talked about tables or grids let us look at the solution of the method that we seek to achieve.

现在我们已经讨论了表或网格,让我们看一下我们要实现的方法的解决方案。

The space between two rows can be adjusted using border-spacing and border-collapse property in CSS.

可以使用CSS中的 border-spacing和border-collapse属性来调整两行之间的间距。

Where border-spacing property is used to set the distance between the borders to its adjacent cells and border-collapse property is used to collapse adjacent cells and make a common border.

其中border-spacing属性用于设置边框与其相邻单元格之间的距离, border-collapse属性用于折叠相邻单元格并创建公共边框。

Syntax:

句法:

    Element{
border-collapse:separate;
border-spacing:length;
}

Example:

例:

<!DOCTYPE html>
<html>
<head>
<style>
table {border-collapse: separate;
border-spacing: 0 15px;
}
th {background-color: #ccc;
color: black;
}
th,
td {width: 160px;
border: 2px solid black;
padding: 4px;
}
</style>
</head>
<body>
<div>
<h3>Adjusting space between two rows in a table</h3>
<table>
<tr>
<th>Roll No.</th>
<th>Name</th>
<th>Gender</th>
</tr>
<tr>
<td class="td">1</td>
<td>Anjali</td>
<td>Female</td>
</tr>
<tr>
<td class="td">2</td>
<td>Hitendra</td>
<td>Male</td>
</tr>
<tr>
<td class="td">3</td>
<td>Nidhi</td>
<td>Female</td>
</tr>
</table>
</div>
</body>
</html>

Output

输出量

Therefore in the above example, you can see the spacing between the adjacent cells of the above table as there is a padding of 4px between every two rows.

因此,在上面的示例中,您可以看到上表的相邻单元格之间间距,因为每两行之间有4px的填充。

Not that hard right? Thus, by making use of border-collapse and the border-spacing property you can adjust the space between two rows in a table using CSS.

不是那么难吗? 因此,通过使用border-collapse和border-spacing属性,您可以使用CSS调整表中两行之间的间隔

翻译自: https://www.includehelp.com/code-snippets/adjusting-space-between-two-rows-in-a-table-using-css.aspx

css表格分两行

css表格分两行_使用CSS调整表格中两行之间的空间相关推荐

  1. css实现图片虚化_什么? CSS 阴影竟然还有这种骚操作 ?

    点击上方"IT平头哥联盟",选择"置顶或者星标" 与你一起成长- 原作者:cocoqiao 关于 CSS 阴影,之前已经有写过一篇,box-shadow 与 f ...

  2. css设置按钮样式_使用CSS设置按钮样式的快速指南

    css设置按钮样式 by Ashwini Sheshagiri 通过Ashwini Sheshagiri Buttons have become an inevitable part of front ...

  3. 使用HTML语言和CSS开发商业站点_初识CSS

    第4章 初识CSS 一.CSS概述     1.什么事CSS         CSS全称为层叠样式表(Cascading Style Sheet),通常又称为风格样式表(Style Sheet),它是 ...

  4. 如何控制表格的宽度_利用Word制作表格,这些实用技巧一定要知道!制作表格更加快捷...

    Hi!大家好!欢迎来到小龙自修室!在这里你可以学到很多:Excel.Word.PPT.PR.AE等软件的使用技巧! 又到了小龙分享时间!之前一直在和大家聊Excel软件使用!相对于制作表格Excel功 ...

  5. layui静态表格设置滚动条_解决layui数据表格table的横向滚动条显示问题

    解决layui数据表格table的横向滚动条显示问题 加上这段样式代码就可以解决了: body{overflow-y: scroll;} /* 禁止刷新后出现横向滚动条 */ ps:这个问题fly社区 ...

  6. wps表格户主序号_如何在Excel表格中对自动设置编号(wps excel查找)

    WPS如何设置产品编码规则 打开一个编好的WPS文档如下: 如果只样的话,文档显的太乱了,条理也不清晰,因此需要文档进行编号,选中文档,鼠标右键,弹出下拉菜单: 选择项目符号和编号,弹出符号和编号对话 ...

  7. 一个div 上下两行_纯CSS实现单一div的正多边形变换

    纯粹利用CSS,让"单一个"div,从正三角形变换为正八边形(单一div最多只能做到正八边形),最后再搭配动画的效果,变成正多边形的变换动画,也由于正多边形需要用到不少的三角函数计 ...

  8. css响应式布局_用 CSS Grid 布局制作一个响应式柱状图

    最新一段时间比较喜欢玩弄图表,出于好奇,我想找出比较好的用 CSS 制作图表的方案.开始学习网上开源图表库,它对我学习新的和不熟悉的前端技术很有帮助,比如这个:CSS Grid. 今天和大家分享我学到 ...

  9. css界面内容可滚动_带有CSS滚动捕捉点的直观滚动界面

    css界面内容可滚动 Scroll Snap Points are a native CSS-only technique that you can use to create layouts whe ...

最新文章

  1. SAP RETAIL 参考PO创建分配表之一
  2. tomcat用80port能够启动,可是浏览器不显示tomcat首页
  3. dns劫持简介 https流量数据获取原理
  4. dubbo源码解析(九)远程通信——Transport层
  5. 【推荐系统】推荐系统冷启动问题
  6. Android 图片放大缩小
  7. python二维列表做参数_python sum函数iterable参数为二维list,start参数为“[]”该如何理解...
  8. 奥运加油,中国加油!!!
  9. java 取字符串中的数字_java截取字符串中的数字
  10. python中文界面设定_python绘图界面中文显示
  11. linux16.04添加用户,Ubuntu16.04下添加新用户
  12. VOLTE信令流程-IMS注册篇(五)
  13. python做题记录之切西瓜
  14. 南非银行“内鬼”偷走主密钥,后将更换1200万张客户卡,损失惨重
  15. LOJ P2448 :无尽的生命 树状数组 + 离散化
  16. OVS代码结构(by quqi99)
  17. 《Oracle Java EE编程自学和面试指南》09-02:HttpSession接口
  18. 【华为云技术分享】如何将90%的代码自动迁移到鲲鹏平台上
  19. 2021年氟化工艺最新解析及氟化工艺找解析
  20. 2022年5月26日【Jiawei_Z】C# 基础教程 -- 各种快捷键的使用

热门文章

  1. 努力的富二代多可怕?曾畅销全球,每天卖出130万瓶的国货大牌“交班”后卖不动了!...
  2. 操作简单伤害却爆炸的中路法师 甄姬实用技巧
  3. IDEA启动tomcat程序1099端口被占用解决方案
  4. 华为手表watch2鸿蒙系统,华为WATCH 3于6月2日发布:搭载鸿蒙操作系统,可测血压...
  5. windows 环境redis 客户端 medis
  6. linux log 日志解析
  7. Docker19版部署及基本操作
  8. 自定义服务器怎么进去,绝地求生自定义服务器玩法介绍 自定义服务器怎么玩...
  9. kotlin设置按钮不可点击_电脑护眼设置开启教程
  10. 如何用matlab求线性方程的通解,利用Matlab求线性方程组的通解