Table Properties

CSS table properties control the appearance and layout of tables, including spacing, borders, alignment, and styling.

PropertyPossible ValuesDescription
border-collapsecollapse, separateMerges or separates table borders
border-spacingpx, emDefines space between table cells (used when border-collapse: separate;)
caption-sidetop, bottomPositions the table caption above or below the table
empty-cellsshow, hideControls visibility of empty table cells
table-layoutauto, fixedDefines how the table width is determined
widthpx, %, autoSets the table width
heightpx, %, autoSets the table height
text-alignleft, center, rightAligns text inside table cells
vertical-aligntop, middle, bottomAligns content vertically in table cells

Explanation of Values

Value TypeDescriptionExample
collapseBorders of adjacent cells mergeborder-collapse: collapse;
separateBorders remain distinctborder-collapse: separate;
fixedColumn width does not change based on contenttable-layout: fixed;
autoColumn width adjusts based on contenttable-layout: auto;
hideHides empty table cellsempty-cells: hide;

Example:

table {
    width: 100%;
    border-collapse: collapse;
}
td, th {
    border: 1px solid black;
    padding: 10px;
    text-align: center;
}

Programs

css code to design a box using div with following specifications

View Solution


css code to design a circle using div with following specifications

View Solution


css code to change the square into circle when mouse is over to the square shape

View Solution


css code to create 3 different colors box which partially overlapped to each other

View Solution


CSS code to blink text using keyframes

View Solution


Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad