{"id":207,"date":"2017-07-17T16:48:40","date_gmt":"2017-07-17T20:48:40","guid":{"rendered":"https:\/\/wpdocs.bu.edu\/research-sister\/?page_id=207"},"modified":"2017-07-18T14:31:21","modified_gmt":"2017-07-18T18:31:21","slug":"tables-lists","status":"publish","type":"page","link":"https:\/\/wpdocs.bu.edu\/research-sister\/style-your-site\/tables-lists\/","title":{"rendered":"Tables &#038; Lists"},"content":{"rendered":"<p>Tables are useful for displaying data sets, and should not be used to display content that can be easily displayed using ordered (numbered) or unordered (bulleted) lists.<\/p>\n<h2>Creating a List<\/h2>\n<p>You can create ordered (<code>ol<\/code>) or unordered (<code>ul<\/code>) lists using the buttons in the WordPress editor toolbar, see below.<\/p>\n<p><img src=\"\/research-sister\/files\/2017\/07\/wp-lists.jpg\" alt=\"wp-lists\" \/><\/p>\n<p><strong>Unordered (bulleted) List<\/strong><\/p>\n<pre>&lt;ul&gt;\r\n  &lt;li&gt;Item 1&lt;\/li&gt;\r\n  &lt;li&gt;Item 2&lt;\/li&gt;\r\n  &lt;li&gt;Item 3&lt;\/li&gt;\r\n&lt;\/ul&gt;<\/pre>\n<p><strong>Ordered (numbered) List<\/strong><\/p>\n<pre>&lt;ol&gt;\r\n  &lt;li&gt;Item 1&lt;\/li&gt;\r\n  &lt;li&gt;Item 2&lt;\/li&gt;\r\n  &lt;li&gt;Item 3&lt;\/li&gt;\r\n&lt;\/ol&gt;<\/pre>\n<h2>Creating a Table<\/h2>\n<p><strong>What is tabular data?<\/strong><br \/>\nIf ALL your items in a column share something in common that is completely different than the items in other columns AND if all the items in a particular row make it distinct from the other rows.<\/p>\n<p>If you do need to use a table, it is important that it is responsive. Follow these steps to make your tables responsive.<\/p>\n<ol>\n<li>Start with adding this code before your table.\n<pre>&lt;div class=\"table-wrapper\"&gt;\r\n   &lt;p class=\"slide-icon\"&gt;Slide left or right to view data&lt;\/p&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p>This adds the &#8220;swipe to scroll&#8221; image in tablet and mobile.<\/p>\n<p><img src=\"\/research-sister\/files\/2017\/07\/table_drag_icon.png\" \/><\/li>\n<li>You can add a table using the &#8220;insert table&#8221; button in the WordPress visual editor toolbar (see below). There you can choose how many columns and rows you want and you can add the data.<img src=\"\/research-sister\/files\/2017\/07\/wp-tables.jpg\" alt=\"wp-tables\" \/><br \/>\n<strong>Note: if you choose to add a table this way you must wrap the table with<\/strong><\/p>\n<pre>&lt;div class=\"responsive-table\"&gt;&lt;\/div&gt;<\/pre>\n<p>Alternatively, you can add this code to the WordPress text editor to create your table. You can add additional columns and rows by copy and pasting the appropriate code.<\/p>\n<pre>&lt;div class=\"responsive-table\"&gt;\r\n   &lt;table&gt;\r\n     &lt;thead&gt;\r\n       &lt;tr&gt;\r\n         &lt;th&gt;Column 1 Heading&lt;\/th&gt;\r\n         &lt;th&gt;Column 2 Heading&lt;\/th&gt;\r\n         &lt;th&gt;Column 3 Heading&lt;\/th&gt;\r\n       &lt;\/tr&gt;\r\n     &lt;\/thead&gt;\r\n     &lt;tbody&gt;\r\n       &lt;tr&gt;\r\n         &lt;td&gt;Row 1, Column 1&lt;\/td&gt;\r\n         &lt;td&gt;Row 1, Column 2&lt;\/td&gt;\r\n         &lt;td&gt;Row 1, Column 3&lt;\/td&gt;\r\n       &lt;\/tr&gt;\r\n       &lt;tr&gt;\r\n         &lt;td&gt;Row 2, Column 1&lt;\/td&gt;\r\n         &lt;td&gt;Row 2, Column 2&lt;\/td&gt;\r\n         &lt;td&gt;Row 2, Column 3&lt;\/td&gt;\r\n       &lt;\/tr&gt;\r\n     &lt;\/tbody&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<\/li>\n<li>The final code should look like this.\n<pre>&lt;div class=\"table-wrapper\"&gt;\r\n   &lt;p class=\"slide-icon\"&gt;Slide left or right to view data&lt;\/p&gt;\r\n&lt;\/div&gt;\r\n\r\n&lt;div class=\"responsive-table\"&gt;\r\n   &lt;table&gt;\r\n     &lt;thead&gt;\r\n       &lt;tr&gt;\r\n         &lt;th&gt;Column 1 Heading&lt;\/th&gt;\r\n         &lt;th&gt;Column 2 Heading&lt;\/th&gt;\r\n         &lt;th&gt;Column 3 Heading&lt;\/th&gt;\r\n       &lt;\/tr&gt;\r\n     &lt;\/thead&gt;\r\n     &lt;tbody&gt;\r\n       &lt;tr&gt;\r\n         &lt;td&gt;Row 1, Column 1&lt;\/td&gt;\r\n         &lt;td&gt;Row 1, Column 2&lt;\/td&gt;\r\n         &lt;td&gt;Row 1, Column 3&lt;\/td&gt;\r\n       &lt;\/tr&gt;\r\n       &lt;tr&gt;\r\n         &lt;td&gt;Row 2, Column 1&lt;\/td&gt;\r\n         &lt;td&gt;Row 2, Column 2&lt;\/td&gt;\r\n         &lt;td&gt;Row 2, Column 3&lt;\/td&gt;\r\n       &lt;\/tr&gt;\r\n     &lt;\/tbody&gt;\r\n&lt;\/div&gt;<\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Tables are useful for displaying data sets, and should not be used to display content that can be easily displayed using ordered (numbered) or unordered (bulleted) lists. Creating a List You can create ordered (ol) or unordered (ul) lists using the buttons in the WordPress editor toolbar, see below. Unordered (bulleted) List &lt;ul&gt; &lt;li&gt;Item 1&lt;\/li&gt; [&hellip;]<\/p>\n","protected":false},"author":12425,"featured_media":0,"parent":116,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/wpdocs.bu.edu\/research-sister\/wp-json\/wp\/v2\/pages\/207"}],"collection":[{"href":"https:\/\/wpdocs.bu.edu\/research-sister\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wpdocs.bu.edu\/research-sister\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/wpdocs.bu.edu\/research-sister\/wp-json\/wp\/v2\/users\/12425"}],"replies":[{"embeddable":true,"href":"https:\/\/wpdocs.bu.edu\/research-sister\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":12,"href":"https:\/\/wpdocs.bu.edu\/research-sister\/wp-json\/wp\/v2\/pages\/207\/revisions"}],"predecessor-version":[{"id":233,"href":"https:\/\/wpdocs.bu.edu\/research-sister\/wp-json\/wp\/v2\/pages\/207\/revisions\/233"}],"up":[{"embeddable":true,"href":"https:\/\/wpdocs.bu.edu\/research-sister\/wp-json\/wp\/v2\/pages\/116"}],"wp:attachment":[{"href":"https:\/\/wpdocs.bu.edu\/research-sister\/wp-json\/wp\/v2\/media?parent=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}