{ LearnWebSiteDesign.com }
HTML, XHTML CSS Tutorials and Free Website Templates
CSS Table Properties Tutorials
Tables are meant to be used to show the relationship between data, similar to a spreadsheet. Tables are not meant to control the layout of HTML elements, for example, to layout web pages.
CSS table properties allow you to style table borders, set the placement of the table caption, control the layout of the table and also to control the spacing between table cells.
CSS Table Properties
The table properties are listed below.
| Property | Description | Values | CSS level |
|---|---|---|---|
| border-collapse | Specifies whether or not table borders should be collapsed |
collapse
seperate inherit |
CSS level 2 |
| border-spacing | Specifies the distance between the borders of adjacent cells |
length lengt
inherit |
CSS level 2 |
| caption-side | Specifies the placement of a table caption |
top
bottom inherit |
CSS level 2 |
| empty-cells | Specifies whether or not to display borders and background on empty cells in a table |
hide
show inherit |
CSS level 2 |
| table-layout | Sets the layout algorithm to be used for a table |
auto
fixed inherit |
CSS level 2 |
How To Set the Border of Tables and Table Elements
The border property is used to set the border of tables and table elements (table headings (th) and table cells(td)).
The code example below shows you how to set the border of a table element.
The web page that the code example creates is here: CSS Table Properties Example.
Notice that, in the example above, the border only surrounds the table (table) element.
The code example below shows you how to apply a border to the table (table), table heading (th) and table cell (td) elements.
The web page that the code example creates is here: CSS Table Properties Example.
How To Collapse Borders
When a border is applied to the table element and also the table heading element and/or the table cell element, as in the table example above, this causes the causes the elements to have seperate borders.
The border-collapse property with a value of collapse is used to display a single border for the table
The code example below shows you how to display a single border for the table and its' table elements.
The web page that the code example creates is here: CSS Table Properties Example.
How To Set Table and Table Elements Width and Height
The width and height of a table and its' table elements are defined by the width and height properties.
The code example below shows you how to set the width and height of a table and its' table elements.
The web page that the code example creates is here: CSS Table Properties Example.
Table Text Alignment
The text-align and vertical-align properties allow you to align text in a table.
The code example below shows you how to align the text within the table using the text-align property.
The web page that the code example creates is here: CSS Table Properties Example.
The code example below shows you how to use the vertical-align property to set the vertical alignment of text within table headings and table cells.
The web page that the code example creates is here: CSS Table Properties Example.
Table Element Padding
The padding property is used to control the spacing between the border and the content within table headings (th) and table cells (td).
The code example below shows you how to set the padding within the table headings and table cells.
The web page that the code example creates is here: CSS Table Properties Example.
Table Color
CSS allows you to specify the color of the borders, background colors and text of table elements (table headings (th) and table cells (td)).
The code example below shows you how to specify the color of table borders, text and background color of table elements.
The web page that the code example creates is here: CSS Table Properties Example.
Tutorials
Templates
References
Sponsors
You can get your website online using Velnet, a leading UK web hosting provider. They provide free template and installation for WordPress blogs. Discuss webmaster related topics at Webmaster Serve, a Webmaster SEO forum
SouthernWebGroup.com provides high quality website design in Atlanta, GA as well as around the world.
Find low cost cheap website hosting and domain registration.
Browser our free no ads web hosting directory and find the free web hosting that's right for you and your budget.
Advertise your web design and web development related products and services here.
- Web Hosting UK
- Web Design Manchester
- Cheap Web Hosting
- free website hosting reviews
- ecommerce design
- Advertise
Recommended
Download free css web hosting templates that are easy to edit at FreeWebHostingTemplates.com.
Friends
- free web hosting templates
- free web hosting templates
- free web hosting reviews
- Web Development
- HD Wallpapers
- best web hosting providers
- Web Hosting Blog
- domain names
- iPage Host Reviews
- Reliable Bluehost Reviews
- Programming Forum
- Alojamento Web
- criar sites
- Free Facebook Banners
- Free No Ads Web Hosting Reviews
- Cheap Web Hosting Reviews
- Free Web Hosting Templates
- Free Premium Wordpress Themes
- Free Premium Wordpress Themes
- Free Joomla Template
- Free Wordpress Themes
- Best Android Apps
- Wordpress Themes Gallery
- Information technology courses
- Free PSD Files