bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/CSS/CSS Foundations
CSS•CSS Foundations

CSS Responsive Tables

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind CSS Responsive Tables?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___.tablecontainer {
3Order

Put the learning moves in the order that makes the concept easiest to apply.

A responsive table will display a horizontal scrollbar if the screen is too small to display the full content.
CSS Table Properties
CSS Responsive Tables

A responsive table will display a horizontal scrollbar if the screen is too small to display the full content.

Resize the browser window to see the effect:

First NameLast NamePointsPointsPointsPointsPointsPointsPointsPointsPointsPointsPointsPoints
JillSmith505050505050505050505050
EveJackson949494949494949494949494
AdamJohnson676767676767676767676767

How to do it

Wrap the <table> element in a <div> container.

Set the overflow-x property to auto for the <div> element:

Example

Formatted code
div.tablecontainer {
  overflow-x: auto;
}

Live preview

Note

In OS X Lion (on Mac), scrollbars are hidden by default and are only shown when being used (even though "overflow:scroll" is set).

CSS Table Properties

PropertyDescription
borderSets all the border properties in one declaration
border-collapseSpecifies whether or not table borders should be collapsed
border-spacingSpecifies the distance between the borders of adjacent cells
caption-sideSpecifies the placement of a table caption
empty-cellsSpecifies whether or not to display borders and background on empty cells in a table
table-layoutSets the layout algorithm to be used for a table

Previous

CSS Table Styling

Next

CSS The display Property