Placing disc or Circle or square markers does not work

Asked

Viewed 38 times

0

I did that

<tr class="espaco-branco table-prod-add">
   <ul type="disc">
       <li>
           <td style="white-space: nowrap;">                           
             @mainItem.ShoppingCartMessage
           </td>
        </li>
   </ul>
</tr>

It turns out that the text that is in @mainItem.ShoppingCartMessage does not come with that "ball" or "square" in front. What is happening?

It’s like this inserir a descrição da imagem aqui

Notice by the image, that even without text the square or disc keeps appearing and before the vertical line and my code now, for this image is like this, trying not to print the square in an empty text

<tr class="espaco-branco table-prod-add">
   <td style="white-space: nowrap;">
      <ul>
        @if (!string.IsNullOrEmpty(mainItem.ShoppingCartMessage))
        {
           <li style="list-style: square; margin-left: 15px">             
                @mainItem.ShoppingCartMessage
           </li>
         }
      </ul>
    </td>                                        
</tr>

I just don’t understand why saquare is outside the table, as shown, applying the code above. With the above code I eliminated the square when the mainItem is null or empty, now I just need to understand why the square or disc is outside the table

  • because you can’t put a list inside a line (tr), put it inside the td that will work

  • @Ricardopunctual, so I did as you suggested and it didn’t work either. Which I find strange that <ul> doesn’t recognize the type. It accepts typeof, but not type. <td style="white-space: nowrap;">&#xA; <ul type="square">&#xA; <li>&#xA; @mainItem.ShoppingCartMessage&#xA; </li>&#xA; </ul>&#xA; </td>

  • Doing so: <td style="list-style: square"> I can, but there’s a vertical line (limiting to tr) and the text is within that line, but the square is outside.

  • I solved the vacuum problem. The whole point is that the disc is out of line, as picture and text inside. To put the disc inside, I have to set the Margin, but I wouldn’t like that. What I have to do?

  • quiet, but again, the tr was not made to layout with a list, nested just below the tr should be a td or th, if you need a line for a layout should use an element as div with the display as inline or inline-block

1 answer

0

See the code you put in the comment:

<table>
  <tr>
     <td style="white-space: nowrap;">
       <ul type="square">
         <li> @mainItem.ShoppingCartMessage </li>
        </ul>
      </td>
   </tr>
   <tr>
      <td style="white-space: nowrap;">
       <ul type="disc">
         <li> @mainItem.ShoppingCartMessage </li>
        </ul>
      </td>
  </tr>
</table>

Appears perfectly, using the list at the right place (inside the td) appears right

  • I couldn’t tag it <UL>. Only works in <li> and with style="list-style: square". With type="square" or "disc" only, does not work

  • With that code: <tr class="espaco-branco table-prod-add"> <td style="white-space: nowrap;">&#xA; <ul>&#xA; @if (!string.IsNullOrEmpty(mainItem.ShoppingCartMessage))&#xA; {&#xA; <li style="list-style: square">&#xA; @mainItem.ShoppingCartMessage&#xA; </li>&#xA; }&#xA; </ul>&#xA; </td> &#xA; </tr> and the square remains outside the table boundaries

  • If I put the margin-left of the list to 15 or more px, then the disc or square is ok, but I would not like to fix manually with value in pixels, due to several browsers used by customers, could give "tilt". Does anyone have any suggestions?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.