0% found this document useful (0 votes)
36 views

WWW W3schools Com Css Css Table ASP

This document discusses how to style HTML tables using CSS. It covers adding borders to tables and table cells, making tables full-width, collapsing borders to remove double borders, and styling other table properties like size, alignment, and responsiveness.

Uploaded by

diegocytv2018
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

WWW W3schools Com Css Css Table ASP

This document discusses how to style HTML tables using CSS. It covers adding borders to tables and table cells, making tables full-width, collapsing borders to remove double borders, and styling other table properties like size, alignment, and responsiveness.

Uploaded by

diegocytv2018
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

 Tutorials


References

Exercises

Sign Up Get Certified Log in

Dark mode
Dark code
 HTML
CSS Tutorial CSS JAVASCRIPT SQL PYTHON JAVA PHP BOOTSTRAP   
CSS HOME ADVERTISEMENT
CSS Introduction
CSS Syntax
CSS Selectors
CSS How To
CSS Comments
CSS Colors
CSS Tables
CSS Backgrounds
CSS Borders
❮ Previous Next ❯
CSS Margins
CSS Padding
The look of an HTML table can be greatly improved with CSS:
CSS Height/Width
CSS Box Model
CSS Outline Company Contact Country
CSS Text
Alfreds Futterkiste Maria Anders Germany
CSS Fonts
CSS Icons Berglunds snabbköp Christina Berglund Sweden
CSS Links
CSS Lists Centro comercial Moctezuma Francisco Chang Mexico
CSS Tables
Ernst Handel Roland Mendel Austria
Table Borders
Island Trading Helen Bennett UK
Table Size

Table Alignment Königlich Essen Philip Cramer Germany


Table Style
Laughing Bacchus Winecellars Yoshi Tannamuri Canada
Table Responsive
CSS Display Magazzini Alimentari Riuniti Giovanni Rovelli Italy
CSS Max-width
CSS Position
CSS Z-index Try it Yourself »
CSS Overflow
CSS Float
CSS Inline-block
CSS Align
Table Borders
CSS Combinators
To specify table borders in CSS, use the border property.
CSS Pseudo-class
CSS Pseudo-element The example below specifies a solid border for <table>, <th>, and <td> elements:
CSS Opacity
CSS Navigation Bar Firstname Lastname
CSS Dropdowns Peter Griffin
COLOR PICKER
CSS Image Gallery Lois Griffin
CSS Image Sprites
CSS Attr Selectors
CSS Forms
Example
CSS Counters
CSS Website Layout

table, th, td {
CSS Units border: 1px solid;
CSS Specificity }
Get certified
CSS !important
by completing
CSS Math Functions Try it Yourself »
a CSS
CSS Advanced course today!
CSS Rounded Corners
school
w3 s
CSS Border Images ADVERTISEMENT

CSS Backgrounds
CSS Colors
3
CE

02

TI 2
R

FI .
ED
CSS Color Keywords
CSS Gradients
CSS Shadows
Get started
CSS Text Effects
CSS Web Fonts
CSS 2D Transforms
CSS 3D Transforms
CSS Transitions
CSS Animations
Full-Width Table
The table above might seem small in some cases. If you need a table that should span the entire screen (full-width),
add width: 100% to the <table> element:
CSS Tutorial
CSS HOME Firstname Lastname
CSS Introduction
Peter Griffin
CSS Syntax
Lois Griffin
CSS Selectors
CSS How To
CSS Comments
CSS Colors
Example
ADVERTISEMENT
CSS Backgrounds
table {
CSS Borders
width: 100%;
CSS Margins
}
CSS Padding
CSS Height/Width
Try it Yourself »
CSS Box Model
CSS Outline
CSS Text
CSS Fonts
CSS Icons Double Borders
CSS Links
Notice that the table in the examples above have double borders. This is because both the table and the <th> and
CSS Lists
<td> elements have separate borders.
CSS Tables
Table Borders To remove double borders, take a look at the example below.

Table Size

Table Alignment

Table Style

Table Responsive Collapse Table Borders


CSS Display
The border-collapse property sets whether the table borders should be collapsed into a single border:
CSS Max-width
CSS Position
Firstname Lastname
CSS Z-index
Peter Griffin
CSS Overflow
Lois Griffin
CSS Float
CSS Inline-block
CSS Align
Example
CSS Combinators
CSS Pseudo-class table {
CSS Pseudo-element border-collapse: collapse;
CSS Opacity }
CSS Navigation Bar
CSS Dropdowns Try it Yourself »
CSS Image Gallery
CSS Image Sprites
CSS Attr Selectors
If you only want a border around the table, only specify the border property for <table>:
CSS Forms
CSS Counters Firstname Lastname
CSS Website Layout Peter Griffin
CSS Units Lois Griffin
CSS Specificity
CSS !important
CSS Math Functions Example
CSS Advanced table {
border: 1px solid;
CSS Rounded Corners
}
CSS Border Images
CSS Backgrounds
CSS Colors Try it Yourself »
CSS Color Keywords
CSS Gradients
CSS Shadows
CSS Text Effects ❮ Previous Next ❯
CSS Web Fonts
CSS 2D Transforms
CSS 3D Transforms
CSS Transitions
CSS Animations ADVERTISEMENT
CSS Tutorial
CSS HOME
CSS Introduction
CSS Syntax
CSS Selectors
CSS How To ADVERTISEMENT
CSS Comments
CSS Colors
CSS Backgrounds
CSS Borders  
CSS Margins
CSS Padding
Did You Know?
CSS Height/Width
From its release in 2003 until 2014, the Nokia
CSS Box Model 1100 has sold over 250 million unit's
CSS Outline worldwide, making it the best selling
consumer electronic device in history.
CSS Text
CSS Fonts
CSS Icons
CSS Links
CSS Lists Report Error Spaces Upgrade Newsletter Get Certified
CSS Tables
Table Borders

Table Size Top Tutorials Top References Top Examples Get Certified
Table Alignment HTML Tutorial HTML Reference HTML Examples HTML Certificate
CSS Tutorial CSS Reference CSS Examples CSS Certificate
Table Style JavaScript Tutorial JavaScript Reference JavaScript Examples JavaScript Certificate
How To Tutorial SQL Reference How To Examples Front End Certificate
Table Responsive
SQL Tutorial Python Reference SQL Examples SQL Certificate
CSS Display Python Tutorial W3.CSS Reference Python Examples Python Certificate
CSS Max-width W3.CSS Tutorial Bootstrap Reference W3.CSS Examples PHP Certificate
Bootstrap Tutorial PHP Reference Bootstrap Examples jQuery Certificate
CSS Position PHP Tutorial HTML Colors PHP Examples Java Certificate
CSS Z-index Java Tutorial Java Reference Java Examples C++ Certificate
C++ Tutorial Angular Reference XML Examples C# Certificate
CSS Overflow
jQuery Tutorial jQuery Reference jQuery Examples XML Certificate
CSS Float
CSS Inline-block
FORUM | ABOUT
CSS Align
CSS Combinators W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to
avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.
CSS Pseudo-class
CSS Pseudo-element Copyright 1999-2023 by Refsnes Data. All Rights Reserved.
CSS Opacity W3Schools is Powered by W3.CSS.

CSS Navigation Bar


CSS Dropdowns 
CSS Image Gallery
CSS Image Sprites
CSS Attr Selectors
CSS Forms
CSS Counters
CSS Website Layout
CSS Units
CSS Specificity
CSS !important
CSS Math Functions

CSS Advanced
CSS Rounded Corners
CSS Border Images
CSS Backgrounds
CSS Colors
CSS Color Keywords
CSS Gradients
CSS Shadows
CSS Text Effects
CSS Web Fonts
CSS 2D Transforms
CSS 3D Transforms
CSS Transitions
CSS Animations

You might also like