• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

<table> an Auflösung anpassen

XFlorian

New member
Hallo zusamen,

ich habe eine Tabelle, die ich an die jeweilige Auflösung des Users anpassen möchte - dabei ist zu beachten, dass ich 5 Spalten habe dessen Breite fix sein soll (egal in welcher Auflösung) und nur die 6.Spalte soll entsprechend der Auflösung modifiziert werden.

Wie kann ich so etwas berwerkstelligen?
 
Code:
<!DOCTYPE html>

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Fenstertitel</title>
<style type="text/css">
	.fullWidthTable {
		table-layout: fixed;
		width: 100%;
		border: 1px solid red;
	}
	td {
		border: 1px solid blue;
	}
	.c1 {width: 101px;}
	.c2 {width: 102px;}
	.c3 {width: 103px;}
	.c4 {width: 104px;}
	.c5 {width: 105px;}
	.c6 {}
</style>
</head>
<body>
<table class="fullWidthTable">
	<thead>
		<tr>
			<th class="c1">Spalte 1</th>
			<th class="c2">Spalte 2</th>
			<th class="c3">Spalte 3</th>
			<th class="c4">Spalte 4</th>
			<th class="c5">Spalte 5</th>
			<th class="c6">Spalte 6</th>
		</tr>
	</thead>
	<tr>
		<td>1</td>
		<td>2</td>
		<td>3</td>
		<td>4</td>
		<td>5</td>
		<td>6</td>
	</tr>
	<tr>
		<td>1</td>
		<td>2</td>
		<td>3</td>
		<td>4</td>
		<td>5</td>
		<td>6</td>
	</tr>
	<tr>
		<td>1</td>
		<td>2</td>
		<td>3</td>
		<td>4</td>
		<td>5</td>
		<td>6</td>
	</tr>
	<tr>
		<td>1</td>
		<td>2</td>
		<td>3</td>
		<td>4</td>
		<td>5</td>
		<td>6</td>
	</tr>
</table>
</body>
</html>
 
Code:
<!DOCTYPE html>

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Fenstertitel</title>
<style type="text/css">
	.fullWidthTable {
		table-layout: fixed;
		width: 100%;
		border: 1px solid red;
	}
	td {
		border: 1px solid blue;
	}
	.c1 {width: 101px;}
	.c2 {width: 102px;}
	.c3 {width: 103px;}
	.c4 {width: 104px;}
	.c5 {width: 105px;}
	.c6 {}
</style>
</head>
<body>
<table class="fullWidthTable">
	<thead>
		<tr>
			<th class="c1">Spalte 1</th>
			<th class="c2">Spalte 2</th>
			<th class="c3">Spalte 3</th>
			<th class="c4">Spalte 4</th>
			<th class="c5">Spalte 5</th>
			<th class="c6">Spalte 6</th>
		</tr>
	</thead>
	<tr>
		<td>1</td>
		<td>2</td>
		<td>3</td>
		<td>4</td>
		<td>5</td>
		<td>6</td>
	</tr>
	<tr>
		<td>1</td>
		<td>2</td>
		<td>3</td>
		<td>4</td>
		<td>5</td>
		<td>6</td>
	</tr>
	<tr>
		<td>1</td>
		<td>2</td>
		<td>3</td>
		<td>4</td>
		<td>5</td>
		<td>6</td>
	</tr>
	<tr>
		<td>1</td>
		<td>2</td>
		<td>3</td>
		<td>4</td>
		<td>5</td>
		<td>6</td>
	</tr>
</table>
</body>
</html>

Danke das klappt wunderbar. Kannst du mir noch erklären, warum du c1-c5 erhöhst im width tag?
 
? Welches width-tag? Sowas gibt es nicht.

Wenn du das width-Attribut im CSS meinst: wollte einfach nur verschiedene Breiten in den Spalten haben...
 
Zurück
Oben