freeCodeCamp/guide/english/css/styling-tables/index.md

667 B

title
Styling Tables

Styling Tables

Tables can be styled with css properties, such as table-layout,border-collapse,border,width,height,text-align,font,coloretc.

Example

/*set table border to solid black*/
table, th, td {
   border: 1px solid black;
}
table {
    border-collapse: collapse;
}
/*set padding of 15px to all table elements and aligns to left*/
th, td {
    padding: 15px;
    text-align: left;
}

More Information: