Tables are nice and easy way to organize a lot of data. Materialize CSS provides a few utility classes to style table. In addition to improve mobile experience, all tables on mobile-screen widths are centered automatically. Following are the styles for table:
- Stripped Table:
<!DOCTYPE html><html><head><!--Import Google Icon Font--><linkhref=rel="stylesheet"><!-- Compiled and minified CSS --><linkrel="stylesheet"href=<!--Let browser know website isoptimized for mobile--><metaname="viewport"content="width=device-width, initial-scale=1.0"/></head><body><tableclass="striped"><thead><tr><th>Student</th><th>Study Time(days)</th><th>Marks</th></tr></thead><tbody><tr><td>Atul</td><td>2</td><td>80</td></tr><tr><td>Aman</td><td>4</td><td>71</td></tr><tr><td>Ansh</td><td>2</td><td>98</td></tr><tr><td>John</td><td>5</td><td>96</td></tr></tbody></table><!-- Compiled and minified JavaScript --><scriptsrc=</script></body></html>chevron_rightfilter_noneOutput:

- Bordered Table:
<!DOCTYPE html><html><head><!--Import Google Icon Font--><linkhref=rel="stylesheet"><!-- Compiled and minified CSS --><linkrel="stylesheet"href=<!--Let browser know website isoptimized for mobile--><metaname="viewport"content="width=device-width, initial-scale=1.0"/></head><body><tableclass="bordered"><thead><tr><th>Student</th><th>Study Time(days)</th><th>Marks</th></tr></thead><tbody><tr><td>Atul</td><td>2</td><td>80</td></tr><tr><td>Aman</td><td>4</td><td>71</td></tr><tr><td>Ansh</td><td>2</td><td>98</td></tr><tr><td>John</td><td>5</td><td>96</td></tr></tbody></table><!-- Compiled and minified JavaScript --><scriptsrc=</script></body></html>chevron_rightfilter_noneOutput:

- Highlighted Table:
<!DOCTYPE html><html><head><!--Import Google Icon Font--><linkhref=rel="stylesheet"><!-- Compiled and minified CSS --><linkrel="stylesheet"href=<!--Let browser know website isoptimized for mobile--><metaname="viewport"content="width=device-width, initial-scale=1.0"/></head><body><tableclass="highlight"><thead><tr><th>Student</th><th>Study Time(days)</th><th>Marks</th></tr></thead><tbody><tr><td>Atul</td><td>2</td><td>80</td></tr><tr><td>Aman</td><td>4</td><td>71</td></tr><tr><td>Ansh</td><td>2</td><td>98</td></tr><tr><td>John</td><td>5</td><td>96</td></tr></tbody></table><!-- Compiled and minified JavaScript --><scriptsrc=</script></body></html>chevron_rightfilter_noneOutput:
- Centered Table:
<!DOCTYPE html><html><head><!--Import Google Icon Font--><linkhref=rel="stylesheet"><!-- Compiled and minified CSS --><linkrel="stylesheet"href=<!--Let browser know website isoptimized for mobile--><metaname="viewport"content="width=device-width, initial-scale=1.0"/></head><body><tableclass="centered"><thead><tr><th>Student</th><th>Study Time(days)</th><th>Marks</th></tr></thead><tbody><tr><td>Atul</td><td>2</td><td>80</td></tr><tr><td>Aman</td><td>4</td><td>71</td></tr><tr><td>Ansh</td><td>2</td><td>98</td></tr><tr><td>John</td><td>5</td><td>96</td></tr></tbody></table><!-- Compiled and minified JavaScript --><scriptsrc=</script></body></html>chevron_rightfilter_noneOutput:

- Responsive Table:
<!DOCTYPE html><html><head><!--Import Google Icon Font--><linkhref=rel="stylesheet"><!-- Compiled and minified CSS --><linkrel="stylesheet"href=<!--Let browser know website isoptimized for mobile--><metaname="viewport"content="width=device-width, initial-scale=1.0"/></head><body><tableclass="responsive-table"><thead><tr><th>Student</th><th>Study Time(days)</th><th>Marks</th></tr></thead><tbody><tr><td>Atul</td><td>2</td><td>80</td></tr><tr><td>Aman</td><td>4</td><td>71</td></tr><tr><td>Ansh</td><td>2</td><td>98</td></tr><tr><td>John</td><td>5</td><td>96</td></tr></tbody></table><!-- Compiled and minified JavaScript --><scriptsrc=</script></body></html>chevron_rightfilter_noneOuptut:

Recommended Posts:
- Materialize CSS | Breadcrumbs
- Materialize CSS | Media
- Materialize CSS | Colors
- Materialize CSS | Grids
- Materialize CSS | Badges
- Materialize CSS | Helpers
- Materialize CSS | Buttons
- Materialize CSS | Footer
- Materialize | Collapsible
- Materialize CSS | Waves
- Materialize CSS | Tooltips
- Materialize CSS Navbars
- Materialize CSS | Typography
- Materialize CSS | Collections
- Materialize CSS | Pagination
- Materialize CSS | Icons
- Materialize CSS | Preloader
- CSS | Tables
- Materialize | Introduction and Installation
- Materialize CSS - Pulse and Shadow
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


