Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Centering a Table

Featured Replies

Hey guys I just cant figure this out.

 

 

I have a table set up, 1 row with mutiple images, and it scrolls horizontally.I want the table with all the content to be centered in the middle of the page. Been trying a bunch of stuff just cant figure it out.

thanks

 

<div id="content-press" class="content" style="background:fff;">

 

<table height="250" class="content" padding:5;>

 

 

.content{

text-align:center;

}

#content-press {

font-size: 1.1em;

margin: 0;

padding: 0;

width: 800px;

height: 340px;

background-color: #fff;

overflow: auto;

position: relative;

z-index: 0;

}

 

 

any ideas?

You got a link or some more of the page coding fella? Then we might be able to help you easier....

If the #content-press is the parent of the table, use the width and margin: 0 auto:-

#content-press {
font-size: 1.1em;
margin: 0 auto; /*was 0;*/
padding: 0;
width: 800px;
height: 340px;
background-color: #fff;
overflow: auto;
position: relative;
z-index: 0;
}

 

The #content-press should then center in its parent (perhaps the page body) and the table will fill the 800px.

 

If the table is less than 800px you will have to give it a width and center that inside #content-press:-

#content-press table { width: ??px; margin: 0 auto; }

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.