why css styles not applied in project
why css styles not applied in project
dynamic
Posts: 5Questions: 2Answers: 0
Hi,
I just started DataTables with scroll horizontal project listed in Examples of DataTables site. The scroll horizontal and even basic cell style is not even displayed. Then I changed from< class="display nowrap"> to <class="display nowrap dataTable no-footer">, I could see some tables are arranged. but where is scroll horizontal option?. I used google chrome. PFA. any suggestions folks
This discussion has been closed.
Answers
my basic code:
I'm not sure how this affects the table layout but this:
This is affecting the scroll bar. If you remove this code or change the number to 400px, for example, you will see the horizontal scroll bar.
Kevin
Even if I change width: 400px; or remove that part of code,no luck . Still I am not able to see the scroll bar and other CSS styles. Is it something to do with class="display nowrap dataTable no-footer"
I'm able to get the scroll bar with
dataTable no-footer
added:http://live.datatables.net/humihipe/1/edit
If I remove the CSS code I mentioned above then the scroll bar appears as I resize the window horizontally. If i set the width to
400px
then the scroll bar appears right away.I'm not sure what adding
dataTable no-footer
provides. They aren't described in the styling section. What are you trying to achieve by using them?Kevin
no-footer
is something that DataTables adds automatically itself if the table doesn't have atfoot
element. It should not be added manually.The reason it isn't initialising the DataTable is that in your Javascript you have:
But in your HTML:
Change the selector in the Javascript to correctly select your table and it will work.
Allan