• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » Css » Tutorial » CSS Styling Tables
Next →
← Prev

CSS Styling Tables

By Dinesh Thakur

The table properties are used to apply style to the <table> element. You can format a table by changing its layout, spacing between table cells, positioning of table caption etc.

We’ll be covering the following topics in this tutorial:

  • CSS Caption-Side
  • CSS Table-Layout
  • CSS Border-Collapse
  • CSS Border-Spacing
  • CSS Empty-Cells

CSS Caption-Side

The CAPTION-SIDE property is used to specify the position of the caption relative to the table’s box. If it is assigned a value right then the caption will appear on the right of the table. Similarly, you can assign top (default), bottom and left values. MS-Internet Explorer does not support this property. For example:

Table {caption-side : bottom ;}

CSS Table-Layout

The TABLE-LAYOUT property is used to control the layout of the table. The possible values that can be assigned to this property are fixed, auto (default) and inherit.

Value Purpose
Auto
It expands the table according to the contents it contains.
Fixed
The table does not depend upon the contents but depends on the width of columns, borders, cell spacing etc.

                                                 Table {width: 10px; border : thin; table-layout: fixed ;}

CSS Border-Collapse

The BORDER-COLLAPSE property is used to add or remove spacing between each cell of a table. The possible values that can be assigned to it are collapse, separate (default).

Value

 Purpose

Collapse
It is used to remove the space between each cell i.e. cells are squeezed tightly together.
Separate Space is present between each cells of a table.
For example: 
Table {width: 10px; border : thin solid blue ; border-collapse : collapse ;}

CSS Border-Spacing

The BORDER-SPACING property is used to specify the spacing between table cells. The spacing can be specified in term of pixels or in percentage. For example:

Table{border-spacing : 4px;} 
 Td{border-spacing : 2px;}

CSS Empty-Cells

By default, the table cells without contents do not have any border displayed around it. If you want to display a border around it use EMPTY-CELLS property. The possible values that can be assigned to it are SHOW (default in Netscape) and HIDE. For example:

Table{empty-cells : show ;}

You’ll also like:

  1. CSS Styling Lists
  2. CSS font property
  3. CSS position property
  4. CSS padding property
  5. CSS background property
Next →
← Prev
Like/Subscribe us for latest updates     

About Dinesh Thakur
Dinesh ThakurDinesh Thakur holds an B.C.A, MCDBA, MCSD certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps.

Dinesh Thakur is a Freelance Writer who helps different clients from all over the globe. Dinesh has written over 500+ blogs, 30+ eBooks, and 10000+ Posts for all types of clients.


For any type of query or something that you think is missing, please feel free to Contact us.


Primary Sidebar

CSS Tutorials

CSS Tutorials

  • CSS - Font Property
  • CSS - Background Property
  • CSS - CSS - Border-Style Property
  • CSS - Text-Decoration Property
  • CSS - Tables
  • CSS - Position
  • CSS - Syntax and Selectors
  • CSS - List
  • CSS - Margin
  • CSS - Padding

Other Links

  • CSS Tutorials - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2025. All Rights Reserved.

APPLY FOR ONLINE JOB IN BIGGEST CRYPTO COMPANIES
APPLY NOW