How to set table width to 100% in CSS
How to set table width to 100% in CSS
Tester2017
Posts: 145Questions: 23Answers: 17
in DataTables
As the width attribute on the table element is obsolete I would like to know where in my CSS I can set the table width to 100%.
As stated in this example https://datatables.net/examples/basic_init/flexible_width.html:
[..] Typically this is done by assigning width:100% in your CSS, but this presents a problem for Javascript since it can be very hard to get that relative size rather than the absolute pixels.[..]
This discussion has been closed.
Answers
OK, already resolved; changing
width=100%
instyle="width:100%"
resolves the error message.Yes - that's spot on.
Allan
<style>
td{
word-break: break-all !important;
}
</style>