W3.CSS is probably the best framework to stylize a table since there are lots of classes defined here. Many of these classes are multifunctional as to be used for all table tags like- <table>, <tr>, <th>, <td>, etc.
The classes to be used for tables in W3.CSS are as follows-
Except of all these classes, W3.CSS allows many other classes that are generic to many HTML elements. Like: w3-color, w3-right-align, w3-size etc.
Another important class w3-responsive is used with a <div> to make a responsive table
Name
F Name
M Name
Suresh
Sunil
Poonam
Prateek
Devendra
Shivalika
Kartik
Ravikant
Priyanka
Output:
Name
F Name
M Name
Suresh
Sunil
Poonam
Prateek
Devendra
Shivalika
Kartik
Ravikant
Priyanka
Output:
A simple class w3-table-all can apply all the classes discussed so far: w3-table, w3-striped, w3-border and w3-bordered
Name
F Name
M Name
Suresh
Sunil
Poonam
Prateek
Devendra
Shivalika
Kartik
Ravikant
Priyanka
Output:
Name
F Name
M Name
Suresh
Sunil
Poonam
Prateek
Devendra
Shivalika
Kartik
Ravikant
Priyanka
Output:
Name
F Name
M Name
Suresh
Sunil
Poonam
Prateek
Devendra
Shivalika
Kartik
Ravikant
Priyanka
Output:
A simple class w3-hover-color can be used in different <tr> to make that <tr> colored hoverable. Colours can be used from the list of all supported colors by W3.CSS
Name
F Name
M Name
Suresh
Sunil
Poonam
Prateek
Devendra
Shivalika
Kartik
Ravikant
Priyanka
Output:
A simple class w3-responsive can be used in a <div> before the <table> tag to make the entire table Responsive. Responsive tables are those that are displayed with a horizontal scroll bar on small screens. On large screens, it doesn’t matter at all.
Another simple class w3-size can be used with the <table> tag to make the table appear in different sizes. Like- w3-tiny, w3-small, w3-large etc.