1

I have following table:

   <table>
     <tr role="row" class="even">
        <td>Other Color</td>
        <td class="Green">Green<td/>
     </tr>
    </table>

and want to draw green circle in last column. CSS:

.Green{
    font-size:0px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display:inline-block;
    background: green!important;
    border:solid black 3px;}
td {
   border:solid black 3px;}

I need to draw borders for the cell, but when doing so it is drawing border around the circle, not the cell. https://fiddle.jshell.net/Ulee/up3a5fp4/
any tip?

1
  • Well, the cell is the circle and so what else were you expecting :) Put another element inside the td and make it as the circle if you don't want the cell to be a circle. Commented Mar 23, 2016 at 8:38

2 Answers 2

4

Something like this?

.green:after {
  content: "";
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: inline-block;
  background: green!important;
  vertical-align: middle;
}

.green {
  font-size: 0;
}

td {
  border: 3px solid #000;
}
<table>
  <tr role="row" class="even">
    <td>Other Color</td>
    <td class="green">Green</td>
  </tr>
</table>

Sign up to request clarification or add additional context in comments.

Comments

0

css:

.Green{
   border:solid green 3px;
   font-size:0px;
   border-radius: 50%;
   width: 50px;
   height: 50px;
   display:inline-block;
   background: green!important;  
}
td {
  border:solid black 3px;
}

And your html contain a little mistake, your html is: <td/>, but the correct format is: </td>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.