Home  >  Article  >  Web Front-end  >  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
WBOYOriginal
2016-06-24 12:16:581841browse

<?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>

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)

9eb94f73308e63a189add4a31586296c

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>

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

Statement:
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