Site icon T4Tutorials.com

How to show Multiple TDs in a TR, but on separate lines? HTML

How to show Multiple TDs in a TR, but on separate lines?

You can use the display property  as a bock  in CSS. For example we can write the css as td{ border:2px solid red; background:red; }.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>t4tutorials.com</title>
<style type="text/css">
table{
	width:100%;
}
td{
	border:2px solid red;
	background:red;
}
td{display:block;float:left;width:100%}
</style>
</head>

<body>
<table>
		<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
		</tr>
		<tr>
				<td>4</td>
				<td>5</td>
				<td>6</td>
		</tr>
		<tr>
				<td>7</td>
				<td>8</td>
				<td>9</td>
		</tr>
</table>
</body>
</html>

 

Exit mobile version