How to set different properties of an HTML table using CSS. You can set following properties of a table.

  • The border-collapse specifies whether the browser should control the appearance of the adjacent borders that touch each other or whether each cell should maintain its style.

  • The border-spacing specifies the width that should appear between table cells.

  • The caption-side captions are presented in the <caption> element. By default, these are rendered above the table in the document. You use the caption-side property to control the placement of the table caption.

  • The empty-cells specifies whether the border should be shown if a cell is empty.

  • The table-layout allows browsers to speed up layout of a table by using the first width properties it comes across for the rest of a column rather than having to load the whole table before rendering it.

    The border-collapse Property

    This property can have two values collapse and separate.

    The border-spacing Property

    The border-spacing property specifies the distance that separates adjacent cells'. borders. It can take either one or two values; these should be units of length.

    If you provide one value, it will applies to both vertical and horizontal borders. Or you can specify two values, in which case, the first refers to the horizontal spacing and the second to the vertical spacing.

    The caption-side Property

    The caption-side property allows you to specify where the content of a <caption> element should be placed in relationship to the table. The table that follows lists the possible values. This property can have one of the four values top, bottom, left or right. The following example uses each value.

    The empty-cells Property

    The empty-cells property indicates whether a cell without any content should have a border displayed.

    This property can have one of the three values - show, hide or inheritHere is the empty-cells property used to hide borders of empty cells in the <table> element.

    The table-layout Property

    The table-layout property is supposed to help you control how a browser should render or lay out a table.

    This property can have one of the three values: fixed, auto or inheritThe following example shows the difference between these properties.



Do you Know?
Progamming is what actually means ?

What is software development ?

How we categorized software development in different manner.

C Programming
C Plus Plus
Java Development
Web Designing
We cover all the programming concepts in various programming languages, this tutorials are very help full for bigener as well as Experience developer, for the ease of understanding we categorized programming in different manner likewise.