{"id":1530,"date":"2012-07-16T23:21:43","date_gmt":"2012-07-16T23:21:43","guid":{"rendered":"http:\/\/cssreset.com\/?p=1530"},"modified":"2012-07-16T23:21:43","modified_gmt":"2012-07-16T23:21:43","slug":"styling-tables-with-css-made-easy","status":"publish","type":"post","link":"https:\/\/cssdeck.com\/blog\/styling-tables-with-css-made-easy\/","title":{"rendered":"Styling Tables with CSS Made Easy"},"content":{"rendered":"<p>This CSS tutorial covers the basics of styling a table, including dealing with the <code>border-collapse:<\/code> property and properly aligning your elements.<!--more--><\/p>\n<p>This video does a really good job of moving through the essential steps necessary, starting with looking at the borders and margins and making sure to use CSS shorthand where possible to keep things clean and tidy.<\/p>\n<p>Now while the <code>border-collapse:<\/code> and <code>margin<\/code> properties deal with the <code>table {}<\/code> declaration as a whole, <code>padding<\/code> adjustments are in relation to the individual table cells under the <code>td, th {}<\/code> declarations. The <code>text-align:<\/code> property is also relevant to these cells.<\/p>\n<p>Adding a visible border element to a table can help it fit better aesthetically on a page and can also keep things looking more professional. Now adding a <code>border-bottom:<\/code> property to the <code>td, th {}<\/code> declaration will add a visible line under each cell, but you will still need to call out the <code>th {}<\/code> border on it&#8217;s own to have a border more definitive under the header cell.<\/p>\n<p>One last thing that you can add to a simple table like this one is a <code>tr: hover {}<\/code> declaration and insert a slight color change when someone hovers their mouse over a cell. This is done through the use of a <code>background:<\/code> property which dictates color.<\/p>\n<p>If you liked this quick tutorial on styling tables with CSS, you may also enjoy this recent post on <a title=\"Understanding &amp; Clearing Floats CSS Tutorial\" href=\"https:\/\/cssdeck.com\/blog\/\/understanding-clearing-floats-css-tutorial\/\">understand and clearing floats with CSS<\/a>. Thanks for stopping by!<\/p>\n<div class=\"wp-socializer wpsr-share-icons \" data-lg-action=\"show\" data-sm-action=\"show\" data-sm-width=\"768\" ><h3>Share and Enjoy !<\/h3><div class=\"wpsr-si-inner\"><div class=\"wpsr-counter wpsrc-sz-32px\" style=\"color:#000\"><span class=\"scount\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook,twitter,linkedin,pinterest,print,pdf\">0<\/span><\/span><small class=\"stext\">Shares<\/small><\/div><div class=\"socializer sr-popup sr-32px sr-circle sr-opacity sr-pad sr-count-1 sr-count-1\"><span class=\"sr-facebook\"><a rel=\"nofollow\" href=\"https:\/\/www.facebook.com\/share.php?u=\" target=\"_blank\"  title=\"Share this on Facebook\"  style=\"color: #ffffff\" ><i class=\"fab fa-facebook-f\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-twitter\"><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/intent\/tweet?text=%20-%20%20\" target=\"_blank\"  title=\"Tweet this !\"  style=\"color: #ffffff\" ><i class=\"fab fa-twitter\"><\/i><\/a><\/span>\n<span class=\"sr-linkedin\"><a rel=\"nofollow\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=\" target=\"_blank\"  title=\"Add this to LinkedIn\"  style=\"color: #ffffff\" ><i class=\"fab fa-linkedin-in\"><\/i><\/a><\/span>\n<span class=\"sr-pinterest\"><a rel=\"nofollow\" href=\"https:\/\/www.pinterest.com\/pin\/create\/button\/?url=&amp;media=&amp;description=\" target=\"_blank\"  title=\"Submit this to Pinterest\"  style=\"color: #ffffff\" data-pin-custom=\"true\"><i class=\"fab fa-pinterest\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"pinterest\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-print\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Print this article \"  style=\"color: #ffffff\" ><i class=\"fa fa-print\"><\/i><\/a><\/span>\n<span class=\"sr-pdf\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Convert to PDF\"  style=\"color: #ffffff\" ><i class=\"fa fa-file-pdf\"><\/i><\/a><\/span><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>This CSS tutorial covers the basics of styling a table, including dealing with the border-collapse: property and properly aligning your elements.<\/p>\n<p>Share and Enjoy !0Shares0<\/p>\n<p>0<\/p>\n<p> [&#8230;]<\/p>\n<p><a class=\"more-link video\" href=\"https:\/\/cssdeck.com\/blog\/styling-tables-with-css-made-easy\/\" title=\"Click to watch 'Styling Tables with CSS Made Easy'\">Watch Video<\/a><\/p>\n","protected":false},"author":18,"featured_media":1531,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,13],"tags":[67,57,79,73,105,118,102,130],"_links":{"self":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1530"}],"collection":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/comments?post=1530"}],"version-history":[{"count":4,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1530\/revisions"}],"predecessor-version":[{"id":1562,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1530\/revisions\/1562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media\/1531"}],"wp:attachment":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media?parent=1530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/categories?post=1530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/tags?post=1530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}