Home Web Front-end JS Tutorial How to remove the border-collapse_javascript technique in the style attribute when generating gridview

How to remove the border-collapse_javascript technique in the style attribute when generating gridview

May 16, 2016 pm 04:34 PM
border-collapse style

When using gridview under vs2005, by default the gridview control will add border-collapse:collapse;

to the style attribute in the generated html code

Copy code The code is as follows:



The code in the page after binding data is run:
<table cellspacing="0" rules="all" border="0" id="GridView1" style="border-width:0px;border-collapse:collapse;">
<tr>
<th scope="col">id</th><th scope="col">name</th>
</tr><tr>
<td>1</td><td>1</td>
</tr><tr>
<td>2</td><td>2</td>
</tr>
</table>
Copy after login

The gridview control is automatically added: border-collapse:collapse;

To remove this automatically added code, just add CellSpacing="-1", and the html code after adding it is

<table rules="all" border="0" id="GridView1" style="border-width:0px;">
<tr>
<th scope="col">id</th><th scope="col">name</th>
</tr><tr>
<td>1</td><td>1</td>
</tr><tr>
<td>2</td><td>2</td>
</tr>
</table>
Copy after login

Additional point:

GridLines="None" does not display cell borders
CellSpacing="-1" Remove border-collapse:collapse; style in GridView style

Note: The problem encountered in the Firefox browser is that border merging causes some border lines to become thicker. GridLines="None" can solve the problem

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

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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to modify element.style How to modify element.style Nov 24, 2023 am 11:15 AM

Methods for element.style to modify elements: 1. Modify the background color of the element; 2. Modify the font size of the element; 3. Modify the border style of the element; 4. Modify the font style of the element; 5. Modify the horizontal alignment of the element. Detailed introduction: 1. Modify the background color of the element, the syntax is "document.getElementById("myElement").style.backgroundColor = "red";"; 2. Modify the font size of the element, etc.

How to dynamically modify style in react How to dynamically modify style in react Dec 28, 2022 am 10:44 AM

Methods for react to dynamically modify style: 1. Add ref to the element whose style needs to be modified, with syntax such as "<div className='scroll-title clear-fix' ref={ this.manage }>"; 2. Through dynamic control The change of state modifies the style of the element; 3. By using JS code in the DOM, the display and hiding transitions of different DOMs are realized.

What are the new features in Vue3 style and how to use them What are the new features in Vue3 style and how to use them May 14, 2023 pm 10:52 PM

New features of style Vue3.2 version has made many upgrades to the style of single-file components, such as local styles, css variables, and styles exposed to templates. (Learning video sharing: Vue video tutorial) 1. Local style When the label has scoped attribute, its CSS will only be applied to the elements of the current component: hi.example{color:red;} 2. The depth selector is scoped If the selector in the style wants to make a more "deep" selection, that is, affect sub-components, you can use the :deep() pseudo-class: .a:deep(.b){/*...*/ }DOM content created through v-html will not be

Vue error: Unable to use v-bind to bind class and style correctly, how to solve it? Vue error: Unable to use v-bind to bind class and style correctly, how to solve it? Aug 26, 2023 pm 10:58 PM

Vue error: Unable to use v-bind to bind class and style correctly, how to solve it? In Vue development, we often use the v-bind instruction to dynamically bind class and style, but sometimes we may encounter some problems, such as being unable to correctly use v-bind to bind class and style. In this article, I will explain the cause of this problem and provide you with a solution. First, let’s understand the v-bind directive. v-bind is used to bind V

Use the :checked pseudo-class selector to change the style of a selected checkbox or radio button Use the :checked pseudo-class selector to change the style of a selected checkbox or radio button Nov 20, 2023 am 11:48 AM

Because the article is of limited length, only brief code examples are included. Here's an example: Suppose we have the following HTML structure: &lt;!DOCTYPEhtml&gt;&lt;htmllang="en"&gt;&lt;head&gt;&lt;metacharset="UTF-8"&gt;&lt;metaname="viewpo

Exploration of CSS table border properties: border-collapse and border-spacing Exploration of CSS table border properties: border-collapse and border-spacing Oct 25, 2023 am 11:58 AM

Exploration of CSS table border properties: border-collapse and border-spacing In web development, tables are a common element used to display and organize data. In order to make the table more readable and beautiful, we can use CSS to adjust the style of the table. When adjusting table styles, border-collapse and border-spacing are two very commonly used properties. border-collapse: border merge bo

CSS table properties guide: table-layout, border-collapse and caption-side CSS table properties guide: table-layout, border-collapse and caption-side Oct 20, 2023 pm 05:42 PM

CSS table property guide: table-layout, border-collapse and caption-side Table is one of the commonly used layout tools in web design, which can be used to display data and organize content. However, when designing and using tables, the choice of appropriate CSS properties can ensure that the form's appearance and functionality match your needs. This article will introduce three commonly used CSS table properties: table-layout, border-colla

How to use class and style binding arrays to implement multiple bindings in Vue How to use class and style binding arrays to implement multiple bindings in Vue Jun 11, 2023 pm 01:29 PM

Vue is a popular JavaScript framework often used to build interactive web applications. In Vue, class and style binding are two common concepts used to style page elements. Similar to CSS, they can modify the appearance of single or multiple elements through selectors. However, in Vue, class and style bindings allow you to use arrays as values, thus enabling multi-binding. This article will explore how to use class and style to bind array implementations in Vue

See all articles