---
title: "Width på table css"
type: "forum-thread"
url: "https://www.webforum.nu/amne/html-css/192754-width-på-table-css"
topic: "HTML & CSS"
topic_url: "https://www.webforum.nu/amne/html-css"
author: "K@llen"
published: "2015-08-07T20:37:26.000Z"
updated: "2015-08-10T13:55:31.000Z"
replies: 1
views: 979
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/html-css/192754-width-på-table-css"
---

# Width på table css

## #1 — K@llen, 2015-08-07T20:37Z

Hej,
Jag har en div i en div där jag vill centrera innehållet både vertikalt och horisontellt, enligt nedan. Containern är 100% bred. Diven i containern vill jag ha 80% av containerns bredd. Får inte denna bredd att fungera.

Tips?

```
.firstRowContainer {
	width: 100%;
	margin: 0;
	padding: 0;
	background-color: #fff;
	height: 250px; 
	display: table;	
	table-layout: fixed;
}

.firstRowContent {
	width: 80%;
	background-color: red;
	height: 100%;
        display: table-cell;
        text-align: center;
        vertical-align: middle;
}
```

Permalänk: https://www.webforum.nu/p/192754

## #2 — Danne V, 2015-08-10T13:55Z

Du borde väl ha vertical-align:middle på den omslutande divven.

Permalänk: https://www.webforum.nu/p/2318716

---

Tråden på webben: https://www.webforum.nu/amne/html-css/192754-width-på-table-css
