search
HomeWeb Front-endHTML Tutorialtable has no grid lines_html/css_WEB-ITnose

I suddenly discovered why the table has no grid lines? How to set it up?


Reply to discussion (solution)

table{ border:1px solid #515151; border-collapse: collapse;}
table tr td{ border-bottom:1px solid #515151; border-right:1px solid #515151;;line-height:23px; empty-cells:show}

Why can't I write like this:
?
I don't want this effect. There should be no gaps between the lines. How can I do it? Also, let’s talk about the differences between border, margin and padding, thank you.

table{ border:1px solid #515151; border-collapse:collapse;}
table tr td{ border-bottom:1px solid #515151; border-right:1px solid #515151;;line- height:23px; empty-cells:show}
Thank you. It turns out that border-collapse:collapse can eliminate the gaps between lines, but we still need to solve the 3L problem.

CSS代码<style>table{     border-collapse: collapse;/* 边框合并属性  */	 width:200px;}th{     border: 1px solid #666666;}td{     border: 1px solid #666666;}</style>HTML代码<table>	<tr>		<th>姓名</th>		<th>年龄</th>	</tr>	<tr>		<td>www.865171.cn</td>		<td>24</td>	</tr>	<tr>		<td>www.865171.cn</td>		<td>25</td>	</tr>	<tr>		<td>www.865171.cn</td>		<td>23</td>	</tr></table>

needs to be set to

<table cellpadding="0" cellspacing="1"></table>
so that there is no gap; as shown in the picture:

For more table border beautification, please refer to http://blog .sina.com.cn/s/blog_5f08aea001019qmd.html

The padding attribute defines the padding of the element. The padding attribute accepts a length value or a percentage value, but negative values ​​are not allowed.
The margin attribute sets the width of all margins of an element, or sets the width of the margins on each side. As shown in the picture:

Sorry, the above css code is wrong. Both attribute values ​​​​should be set to 0, that is,

needs to be set to CSS code?1

<table cellpadding="0" cellspacing="1"></table>This way there will be no gap; such as As shown in the picture:

For more table border beautification, please refer to http://blog.sina.com.cn/s/blog_5f08aea001019qmd.html

The padding attribute defines the inner margin of the element. The padding attribute accepts length value or percentage... Because the VS2012 I use supports HTML5, so there are margin, border and padding, but there are no old attributes of cellpadding and cellspacing. In fact, the solution is: border-collapse:collapse, but thank you for your answer. So serious. I recently took a web design class and am particularly interested in HTML5. I would like to learn more from you when I have time.

The final complete writing method is

, but I just don’t understand that it doesn’t work like this:

needs to be set to CSS code?1

<table cellpadding="0" cellspacing="1"></table>This way there will be no gap; as shown in the figure :

For more table border beautification, please refer to http://blog.sina.com.cn/s/blog_5f08aea001019qmd.html

The padding attribute defines the inner margin of the element. The padding attribute accepts a length value or a percentage... Oh, another problem is that I have configured a data source for the SQL Server driver under the "Administrative Tool Data Source (ODBC)" on the computer, and bound the data in VS2012 The display or data list control is normal and can display the retrieved data in the database. However, when I use the VS interface to operate the existing data source (the connection string is SqlConString), an error will occur. In other words, the code operation is OK but the interface is The operation doesn't work. I checked online and there are various opinions: how to turn on the computer to connect remotely, turn off the firewall, turn on the SQL Server Browser service, etc., but it just doesn't work. Is this a Microsoft bug? I don’t know if you have encountered this when using VS? Ask for answers. . . The error picture is as follows:

The final complete writing method is

, but I just don’t understand that this doesn’t work:
Changed to
Quoting the reply from Javkburd on the 9th floor: The final complete way of writing is
, but I just don’t understand that it doesn’t work:

means that the table border width is 1, not the width of each cell. If you don’t believe me, try table
and you will find Only the border will become thicker, so table represents the cell border, and this value can only be 0 or 1, because if you take other values, VS Intelligent Sense will prompt an error. Explain: The test environment is: VS 2012 Chrome, supports HTML5.

Quoting the reply from iGiphon on the 6th floor: It needs to be set to CSS code?1

<table cellpadding="0" cellspacing="1"></table> In this way, there will be no gap; as shown in the picture:

For more table border beautification, please refer to http://blog.sina.com.cn/s/blog_5f08aea001019qmd.html

padding attribute definition The inner margin of the element... I suddenly tried it out during the computer class today. It turns out that the data provider is OLE DB instead of SQL Server. The reason is still unclear. The operation method is: Configure data source-New connection-Change-Data. Provider - data provider for .NET
Framework for OLE DB.

Quote from 9th floor Javkburd's reply: The final complete writing method is

, but I just don’t understand that it doesn’t work:

Quoting the reply from zhenxihongyan on the 11th floor: Quoting the reply from Javkburd on the 9th floor: The final complete writing method is
, but I just don’t understand This won't work:

I quoted it wrong just now. . .
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

From Text to Websites: The Power of HTMLFrom Text to Websites: The Power of HTMLApr 13, 2025 am 12:07 AM

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

Understanding HTML, CSS, and JavaScript: A Beginner's GuideUnderstanding HTML, CSS, and JavaScript: A Beginner's GuideApr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The Role of HTML: Structuring Web ContentThe Role of HTML: Structuring Web ContentApr 11, 2025 am 12:12 AM

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

HTML and Code: A Closer Look at the TerminologyHTML and Code: A Closer Look at the TerminologyApr 10, 2025 am 09:28 AM

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

HTML, CSS, and JavaScript: Essential Tools for Web DevelopersHTML, CSS, and JavaScript: Essential Tools for Web DevelopersApr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!