Home >Web Front-end >HTML Tutorial >table has no grid lines_html/css_WEB-ITnose

table has no grid lines_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:20:151478browse

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


Reply to discussion (solution)

e250a3f15cdd83cbdbae9ebf57168797

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}

e250a3f15cdd83cbdbae9ebf57168797 Why can't I write like this: e54f843b819099abaf6a3b44b452ae73?
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, 1a85bbb0241cc43842ddbf00be037be6f16b1740fad44fb09bfe928bcc527e08

needs to be set to CSS code?1e974c6ad2240881c5cada77438a0a218f16b1740fad44fb09bfe928bcc527e08This 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 2ad0ab9bbefbcd2887458f3bffdad0a0, but I just don’t understand that it doesn’t work like this: 07b1e0c99fb6495beba1aa3bfc70dfdb

needs to be set to CSS code?1e974c6ad2240881c5cada77438a0a218f16b1740fad44fb09bfe928bcc527e08This 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 2ad0ab9bbefbcd2887458f3bffdad0a0, but I just don’t understand that this doesn’t work:88b0f23d8bce71187c5e0e0620152e9b
07b1e0c99fb6495beba1aa3bfc70dfdbChanged to21e31c58d0e132b5311de4f9bfacf31b That’s fine, because you didn’t set the border line to be a solid line, and there is no border line by default

.

Quoting the reply from Javkburd on the 9th floor: The final complete way of writing is 2ad0ab9bbefbcd2887458f3bffdad0a0, but I just don’t understand that it doesn’t work: 7c707045bd1e813d710342f48bac65c7
bcd88f0c0329b8b95e837595245cb26c means that the table border width is 1, not the width of each cell. If you don’t believe me, try tabled123b44f8fa2534a64247a925aed006b and you will find Only the border will become thicker, so table978f35a38611beb404904f30b0b0cfd3 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?1e974c6ad2240881c5cada77438a0a218f16b1740fad44fb09bfe928bcc527e08 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 a335c065d79df1794570cfbc49f3050f, but I just don’t understand that it doesn’t work:07b1e0c99fb6495beba1aa3bfc70dfdb

Quoting the reply from zhenxihongyan on the 11th floor: Quoting the reply from Javkburd on the 9th floor: The final complete writing method is 2ad0ab9bbefbcd2887458f3bffdad0a0, but I just don’t understand This won't work:07b1e0c99fb6495beba1aa3bfc70dfdb
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