question

SSRS-VS avatar image
0 Votes"
SSRS-VS asked AgaveJoe commented

Problem with razor (.cshtml) tables. Format number simbol (€ or %) does not fit

I have a table in my razor view (.cshtml). And I show the values of my model. The problem are some numbers, they do not fit completely and put the symbol below:

112121-imagen.png

The red color means that it's wrong and blue means correct. I want the symbol beside the number, not below. The format is given in the model: [DisplayFormat(DataFormatString = "{0:c}")] or [DisplayFormat(DataFormatString = "{0:P2}")]

I tried: .table td, .table th { font-size: 10.5px; white-space: nowrap; } to define my table css style: <table class="table">
But ir didn't work. Any solution?
Thanks

dotnet-aspnet-core-mvc
imagen.png (16.4 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

{white-space: nowrap;} works. There must be something wrong with how you implemented the CSS. Use the browser's dev tools to view the CSS properties applied to the table cells. Or share enough code to reproduce this issue so we can see what you're doing.

0 Votes 0 ·

{white-space: nowrap;} moves all cells, but how can I make {white-space: nowrap;} only on a specific column? I tried to put <th white-space="nowrap;"> or <td white-space="nowrap;"> on the specific column, but it affect to the whole table

0 Votes 0 ·

<td white-space="nowrap;"> on the specific column, but it affect to the whole table

Inline CSS syntax is...

 <td style="white-space: nowrap;">


0 Votes 0 ·

0 Answers