DEV Community

Sathish Kumar
Sathish Kumar

Posted on

1. HTML Table:

A table is used to display data in rows and columns.
Basic tags:

→ Creates a table
→ Creates a table row

→ Creates a table heading → Creates table data/cell Example: HTML
Name Age
Arun 20
  1. Table Border:
    To give a border to the table:
    table, th, td {
    border: 1px solid black;
    }
    border: 1px solid means:
    1px → border thickness
    solid → solid line
    black → border colour
    Border Collapse
    table {
    border-collapse: collapse;
    }
    border-collapse: collapse → joins the borders of nearby cells into a single border.

  2. Media Query:
    Media query is used to make a webpage responsive.
    It helps the website look good on different screen sizes like:
    Mobile 📱
    Tablet 📲
    Laptop/PC 💻
    Example:
    @media (max-width: 760px) {
    body {
    text-align: right;
    }
    p {
    display: none;
    }
    }

Top comments (0)