rust

table Style

Sparisoma Viridi
1 min read ·

example

NoIDuserFull Name
10023youngjediIsaac Einstein
9349975seahorseRajesh Schumacher
330303mystiqueJava Isomov

steps

new code

/* Style for table */
table {
  /* No gaps between borders */
  border-collapse: collapse;
  /* No spacing between cells */
  border-spacing: 0;
}

table th {
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 8px;
  background-color: #f2f2f2;
}

table td {
  /* Padding top/bottom right/left */
  padding: 0.25em 0.5em;
}

table tr:last-child td {
  border-bottom: 1px solid #000;
}

table tr:nth-child(odd) {
  /* White for even rows */
  background-color: #ffffff;
}

table tr:nth-child(even) {
  /* Light gray for odd rows */
  background-color: #f2f2f2;
}

previous code

table {
  border-collapse: collapse; /* Ensures there are no gaps between borders */
  border-spacing: 0; /* Removes any spacing between cells */
}

table th {
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 8px;
  background-color: #f2f2f2;
}

table td {
  padding-right: 2em;
}

table tr:last-child td {
  border-bottom: 1px solid #000;
}

table tr:nth-child(odd) {
  background-color: #ffffff; /* White for even rows */
}

table tr:nth-child(even) {
  background-color: #f2f2f2; /* Light gray for odd rows */
}
Tags: