Why are the data in the columns not formatted properly?

Why are the data in the columns not formatted properly?

izumovizumov Posts: 178Questions: 14Answers: 0

My test case is http://montaj.vianor-konakovo.ru/goods_new.html
At table initiation, I defined column classes

className:"Price","width": "70px" ,targets:[8],
        render:$.fn.dataTable.render.number( ' ', '.', 2,' ',''  )
            },
            {className:"Inoe",targets:[7]},
            {className:"Model",targets:[2],
                            },
            {className:"Ost",targets:[9],               
            },
            {className:"Brend",targets:[1],},

In css I set the rules

.Model
{
width:70px; !important;
text-align:Left !important ;
}

.Brend
{
text-align:Left !important ;
}

But the rules do not work when displaying data. What is the problem? How to achieve the required formatting?

Replies

  • allanallan Posts: 61,711Questions: 1Answers: 10,103 Site admin

    You've got:

    <link rel="stylesheet" type="text/css" href="goods.css"/>
    

    and

    <link href="goods.css" rel="stylesheet">
    

    in the HTML. Could it be as simple as that? Try removing the second one.

    I don't see why it isn't working other than that. The inspector doesn't show the .Brend class being applied at all!

    Allan

  • izumovizumov Posts: 178Questions: 14Answers: 0

    I followed your advice and changed the page here is its option http://montaj.vianor-konakovo.ru/goods_new13.html but alignment still does not work.when I examine the styles in Firefox and place the cursor on a rule of the Size class, the browser displays the column in a dashed blue line, but it doesn’t align the information properly. I don’t understand anything. What is happening.

  • tangerinetangerine Posts: 3,349Questions: 37Answers: 394

    This is not a DataTables issue. The problem is your misuse of your own CSS.

    First, you are using both inline ("style" tags in HTML) and external CSS files, which may be overriding or contradicting each other. Choose inline or external, not both.

    Second, your files goods.css and goods999.css both have many of the same definitions. They also may have conflicting definitions - I didn't check all of them.

    Your CSS is a mess. You need to clean it up. Not a DataTables issue.

This discussion has been closed.