Thuộc tính border-collapse

The border-collapse CSS property sets whether cells inside a

have sầu shared or separate borders.

Bạn đang xem: Thuộc tính border-collapse

When cells are collapsed, the border-style value of inphối behaves lượt thích groove, & outmix behaves like ridge.

When cells are separated, the distance between cells is defined by the border-spacing property.

Xem thêm: Hai Hệ Nguyên Tố Của Triệu Hồi Sư Là? ? Thuật (Naruto) Hệ Phái: Triệu Hồi Sư


/* Keyword values */border-collapse: collapse;border-collapse: separate;/* Global values */border-collapse: inherit;border-collapse: initial;border-collapse: revert;border-collapse: unset;
The border-collapse property is specified as a single từ khoá, which may be chosen from the list below.


collapse

Adjacent cells have sầu shared borders (the collapsed-border table rendering model).

Xem thêm: Xem Ngày Tốt Đổ Mái Tháng 8 Năm 2020, Xem Ngày Đổ Mái Tháng 4/2021

separate

Adjacent cells have sầu distinct borders (the separated-border table rendering model).


Initial valueApplies toInheritedComputed valueAnimation type
separate
table và inline-table elements
yes
as specified
discrete

table class="separate"> caption>code>border-collapse: separatecode>caption> tbody> tr>th>Browserth> th>Layout Engineth>tr> tr>td class="fx">Firefoxtd> td class="gk">Geckotd>tr> tr>td class="ed">Edgetd> td class="tr">EdgeHTMLtd>tr> tr>td class="sa">Safaritd> td class="wk">Webkittd>tr> tr>td class="ch">Chrometd> td class="bk">Blinktd>tr> tr>td class="op">Operatd> td class="bk">Blinktd>tr> tbody>table>table class="collapse"> caption>code>border-collapse: collapsecode>caption> tbody> tr>th>Browserth> th>Layout Engineth>tr> tr>td class="fx">Firefoxtd> td class="gk">Geckotd>tr> tr>td class="ed">Edgetd> td class="tr">EdgeHTMLtd>tr> tr>td class="sa">Safaritd> td class="wk">Webkittd>tr> tr>td class="ch">Chrometd> td class="bk">Blinktd>tr> tr>td class="op">Operatd> td class="bk">Blinktd>tr> tbody>table>
.collapse border-collapse: collapse;.separate border-collapse: separate;table display: inline-table; margin: 1em; border: dashed 5px;table th,table td border: solid 3px;.fx border-color: orange blue; .gk border-color: blaông xã red; .ed border-color: blue gold; .tr border-color: aqua; .sa border-color: silver blue; .wk border-color: gold blue; .ch border-color: red yellow green blue; .bk border-color: navy xanh teal aqua; .op border-color: red;

Specifications

Specification
Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification (CSS 2.1)# propdef-border-collapse

Browser compatibility

BCD tables only load in the browser

See also


Last modified: Aug 12, 2021, by MDoanh Nghiệp contributors

Change your languageSelect your preferred language English (US)DeutschEspañolFrançais日本語한국어Polski中文 (简体) Change language
Learn CSS CSS first steps CSS building blocks Styling text CSS layout Reference Modules Properties Selectors Pseudo-classes Pseudo-elements At-rules Types Guides Animations Backgrounds & Borders Box alignment Box Mã Sản Phẩm Columns Conditional rules CSSOM view Flexbox Flow layout Fonts Grid Images Lists and counters Logical properties Media queries Positioning Scroll snap Shapes Text Transforms Transitions Layout cookbook Tools

Chuyên mục: Blogs