Home > Web Front-end > HTML Tutorial > How to align the top of Table's words_html/css_WEB-ITnose

How to align the top of Table's words_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:16:58
Original
1865 people have browsed it

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">	<head>		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />		<title>Test</title>	</head>		<body>		<table border="1" width="400">			<tr>				<td>日期:</td>				<td>2012-01-01</td>			</tr>			<tr>				<td>记录:</td>				<td>					测试数据<br />					测试数据<br />					测试数据<br />					测试数据<br />					测试数据<br />					测试数据<br />					测试数据<br />					测试数据<br />					测试数据<br />					测试数据<br />				</td>			</tr>		</table>	</body></html>
Copy after login

The running effect is as follows:

But I hope that the two words recorded can be top-aligned, like the picture below

How should I change the above code


Reply to discussion (solution)

Isn’t it in the attribute?

Isn’t it in the attribute?

<table border="1" width="400">            <tr>                <td>日期:</td>                <td>2012-01-01</td>            </tr>            <tr>                <td valign="top">记录:</td>                <td>                    测试数据<br />                    测试数据<br />                    测试数据<br />                    测试数据<br />                    测试数据<br />                    测试数据<br />                    测试数据<br />                    测试数据<br />                    测试数据<br />                    测试数据<br />                </td>            </tr>        </table>
Copy after login

What does attribute mean?

Just add this in tr style="vertical-align:top"

That’s what the 6th floor said

Just add this in tr style="vertical-align:top"

Agree, but it doesn’t seem to work for barcode fonts

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template