table has no grid lines_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:20:15
Original
1452 people have browsed it

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>
Copy after login

needs to be set to

<table cellpadding="0" cellspacing="1"></table>
Copy after login
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:< table style = "border:1px; border-collapse:collapse">
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. . .

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template