martes, 7 de septiembre de 2021

CSS Walk 7 Tables

 CSS Walk 7 Tables

 


 
Let´s create a table of five columns and five rows, to make it easier use the emmet notation
inside <table>
tr*5{Item #$}*5 on the body of a html file.

  <body>
    <table>
      <tr>
        <td>Item #1</td>
        <td>Item #2</td>
        <td>Item #3</td>
        <td>Item #4</td>
        <td>Item #5</td>
      </tr>
      <tr>
        <td>Item #1</td>
        <td>Item #2</td>
        <td>Item #3</td>
        <td>Item #4</td>
        <td>Item #5</td>
      </tr>
      <tr>
        <td>Item #1</td>
        <td>Item #2</td>
        <td>Item #3</td>
        <td>Item #4</td>
        <td>Item #5</td>
      </tr>
      <tr>
        <td>Item #1</td>
        <td>Item #2</td>
        <td>Item #3</td>
        <td>Item #4</td>
        <td>Item #5</td>
      </tr>
      <tr>
        <td>Item #1</td>
        <td>Item #2</td>
        <td>Item #3</td>
        <td>Item #4</td>
        <td>Item #5</td>
      </tr>
    </table>
  </body>
 

Need to add border

table {
  border1px solid black;
}
 

 Add border to each element of data table

table {
  border1px solid black;
}

table td {
  border1px solid black;
}
 
Change the double border
 
table {
  border1px solid black;
  border-collapsecollapse;
}

table td {
  border1px solid black;
}



Add padding on each cell
 
table {
  border1px solid black;
  border-collapsecollapse;
}

table td {
  border1px solid black;
  padding10px;
}

 

Let´s see what happens when a cell has a text more bigger.

adjust the width of the table data
 
table {
  border1px solid black;
  border-collapsecollapse;
}

table td {
  border1px solid black;
  padding10px;
  width300px;
}

 

 Select the row when the mouse pass over it.

table {
  border1px solid black;
  border-collapsecollapse;
}

table td {
  border1px solid black;
  padding10px;
}

table tr:hover {
  backgroundrgb(18202202);
}
 
Set the background of the cell where the mouse pass over.

table {
  border1px solid black;
  border-collapsecollapse;
}

table td {
  border1px solid black;
  padding10px;
}

table tr:hover {
  backgroundrgb(18202202);
}

table td:hover {
  backgroundrgb(12128128);
  colorrgb(18202202);
}
 


eot

No hay comentarios:

Publicar un comentario