【发布时间】:2014-02-10 03:53:52
【问题描述】:
我的搜索结果截图:
帮助我为每个内容获取相似的列或固定列。随着歌曲名称长度的增加,它会扩展。
我的表格代码很简单:
<table id="dataTable" border="1" width="70%" cellspacing="0" cellpadding="5">
<thead>
<tr>
<th><font color="green"><?php echo $MusicTitle;?></font></th>
<th><font color="red"><?php echo $p['bit'];?></font></th>
<th><a class="orange" href="<?php echo $p['url'];?>">Download</a></th>
</tr>
</thead>
【问题讨论】:
-
您要么需要指定宽度并对它们感到满意(例如,用省略号截断文本),要么使用图像字符串测量函数并将大小传递给输出,这有点像kaput 因为它取决于字体渲染,而您的客户端可能没有相同的字体?堆栈答案:stackoverflow.com/questions/1641756/…
-
请避免
<font>。改用 CSS 选择器(#datatable thead th:nth-child(1) { color: green; }或 CSS 类,或者如果不能包含任何一种,请使用内联样式 à la<th style="color:green;">
标签: html html-table